pull down to refresh

I really like nmtui but damn, the color scheme SUCKS:

5000 sats for who tells me how to fix this in a way that ONLY affects nmtui.

$ echo $XTERM
tmux-256color

bonus sats if you're using the catppuccin mocha colors

5,000 sats bounty

You can inject your own color config using:

sudoedit /etc/newt/palette

Or better:

mkdir -p ~/.config/nmtui
cp /etc/newt/palette ~/.config/nmtui/palette

Then edit your alias:

alias nmtui='NEWT_COLORS=$(<~/.config/nmtui/palette) nmtui'

You can tweak the palette like:

root=white,black
border=black,brightblue
window=gray,black
title=brightwhite,black
button=black,gray
button_active=brightwhite,blue
checkbox=green,black

Catppuccin Mocha-inspired tweaks:

root=lavender,crust
border=sapphire,base
window=overlay0,base
title=rosewater,crust
button=surface2,lavender
button_active=crust,maroon

To apply:

export NEWT_COLORS=$(<~/.config/nmtui/palette)
nmtui

BONUS One-liner:

alias nmtui='NEWT_COLORS="root=lavender,crust border=sapphire,base window=overlay0,base title=rosewater,crust button=surface2,lavender button_active=crust,maroon" nmtui'

Replace the color names with Xterm-256-compatible ones or hex via terminal emulators that support truecolor.

reply

This is the dark palette I use. Sharing it because people might want to see all the element names:

root=white,black
border=black,lightgray
window=lightgray,lightgray
shadow=black,gray
title=black,lightgray
button=black,cyan
actbutton=white,cyan
compactbutton=black,lightgray
checkbox=black,lightgray
actcheckbox=lightgray,cyan
entry=black,lightgray
disentry=gray,lightgray
label=black,lightgray
listbox=black,lightgray
actlistbox=black,cyan
sellistbox=lightgray,black
actsellistbox=lightgray,black
textbox=black,lightgray
acttextbox=black,cyan
emptyscale=,gray
fullscale=,cyan
helpline=white,black
roottext=lightgrey,black

reply

Cool, this works!

I have to tweak it a little to make it look better but this already helped me a lot. I will pay you the bounty.

However, I see you don't have a horse which means you don't have a wallet attached. Do you want to attach a wallet first so you can receive sats?

reply

there's an available repo?

reply
0 sats \ 0 replies \ @xordanblu 12 May freebie -30 sats

Catppuccin Mocha nmtui-only wrapper. This does not touch your terminal theme, tmux config, or other TUI apps; it only sets newt colors for the single nmtui process.

Put this in ~/.config/nmtui/catppuccin-mocha.newt:

root=#cdd6f4,#1e1e2e
roottext=#cdd6f4,#1e1e2e
window=#cdd6f4,#1e1e2e
border=#89b4fa,#1e1e2e
shadow=#11111b,#11111b
title=#f5c2e7,#1e1e2e
label=#cdd6f4,#1e1e2e
textbox=#cdd6f4,#1e1e2e
acttextbox=#1e1e2e,#89b4fa
entry=#cdd6f4,#313244
disentry=#6c7086,#313244
button=#cdd6f4,#313244
actbutton=#1e1e2e,#89b4fa
compactbutton=#cdd6f4,#45475a
checkbox=#a6e3a1,#1e1e2e
actcheckbox=#1e1e2e,#a6e3a1
listbox=#cdd6f4,#313244
actlistbox=#1e1e2e,#89b4fa
sellistbox=#cdd6f4,#45475a
actsellistbox=#1e1e2e,#b4befe
helpline=#a6adc8,#1e1e2e
emptyscale=#6c7086,#313244
fullscale=#a6e3a1,#313244

Then add a shell function instead of a global export:

nmtui() {
  local palette
  palette="$(tr '
' ' ' < "$HOME/.config/nmtui/catppuccin-mocha.newt")"
  env NEWT_COLORS="$palette" command nmtui "$@"
}

Test without installing the function:

palette="$(tr '
' ' ' < ~/.config/nmtui/catppuccin-mocha.newt)"
NEWT_COLORS="$palette" command nmtui

Why this is scoped correctly: nmtui is a newt app, and newt reads the NEWT_COLORS environment variable. Because the variable is passed through env only when launching command nmtui, it dies with that process and does not affect tmux, your shell, vim, htop, etc.

If your distro's newt build does not honor #RRGGBB values, keep the wrapper and replace the palette with ANSI names. The scope remains the same:

root=white,black roottext=white,black window=white,black border=brightblue,black title=magenta,black button=white,black actbutton=black,brightblue checkbox=green,black actcheckbox=black,green listbox=white,black actlistbox=black,brightblue textbox=white,black entry=white,black helpline=gray,black
0 sats \ 0 replies \ @hermmon 7 Aug freebie -100 sats

nmtui is a newt app, and newt lets you override its palette per-invocation β€” no system config needed. Two env vars are read at startup (initColors in newt.c): NEWT_COLORS (inline string) or NEWT_COLORS_FILE (path to a palette file). Scope one to an alias so only nmtui is affected and whiptail & co. stay untouched:

mkdir -p ~/.config/nmtui
cat > ~/.config/nmtui/palette <<'EOF'
root=color189,color235
window=color189,color235
border=color111,color237
title=color111,color235
button=color111,color239
actbutton=color235,color111
checkbox=color111,color237
actcheckbox=color235,color151
entry=color189,color237
label=color146,color235
listbox=color189,color235
actlistbox=color235,color111
textbox=color189,color235
acttextbox=color189,color239
helpline=color243,color235
roottext=color243,color235
sellistbox=color189,color237
actsellistbox=color235,color111
emptyscale=color239,color235
fullscale=color111,color235
disentry=color243,color237
compactbutton=color111,color239
EOF
alias nmtui='NEWT_COLORS_FILE="$HOME/.config/nmtui/palette" nmtui'

source ~/.bashrc and done β€” that's Catppuccin Mocha (bonus claimed πŸ˜„). colorN names are xterm-256 indexes, which is exactly what tmux-256color speaks: text #cdd6f4β†’189, base #1e1e2eβ†’235, surface0 #313244β†’237, blue #89b4faβ†’111, green #a6e3a1β†’151, subtext1 #bac2deβ†’146, overlay0 #6c7086β†’243.

Three traps worth knowing:

  1. Don't export NEWT_COLORS in ~/.profile β€” it restyles every other newt TUI (whiptail, installer dialogs), not just nmtui. The alias scoping is what makes it "only nmtui".
  2. The key names are newt's own (from parseColors in newt.c): actbutton, actlistbox, sellistbox, disentry. Ubuntu's /etc/newt/palette line disabledentry=… is silently ignored β€” newt only knows disentry.
  3. In tmux, make sure the session isn't degrading to 8 colors: set -g default-terminal "tmux-256color".

newt can't go beyond 256 (S-Lang layer), so colorN is as close to the mocha hexes as it gets β€” visually indistinguishable on most terminals.

deleted by author

reply
NEWT_COLORS='window=blue' nmtui

This doesn't seem to do anything

NEWT_COLORS='window=white,red border=white,red checkbox=white,red actcheckbox=white,green' nmtui

This at least changed something:

btw, did you use AI for this reply?

reply

deleted by author