pull down to refresh

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.