Created
May 20, 2019 13:16
-
-
Save ymkins/bb0885326f3e38850bc444d89291987a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## Set newt color palette for dialogs | |
NEWT_COLORS_0=' | |
root=,blue | |
' | |
NEWT_COLORS_1=' | |
root=,blue | |
checkbox=,blue | |
entry=,blue | |
label=blue, | |
actlistbox=,blue | |
helpline=,blue | |
roottext=,blue | |
emptyscale=blue | |
disabledentry=blue, | |
' | |
NEWT_COLORS_2=' | |
root=green,black | |
border=green,black | |
title=green,black | |
roottext=white,black | |
window=green,black | |
textbox=white,black | |
button=black,green | |
compactbutton=white,black | |
listbox=white,black | |
actlistbox=black,white | |
actsellistbox=black,green | |
checkbox=green,black | |
actcheckbox=black,green | |
' | |
NEWT_COLORS_3=' | |
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 | |
' | |
export NEWT_COLORS=$NEWT_COLORS_0 |
I love it, I used it to improve my dialog boxes on my own Makefiles, I hope it helps to someone else as it helps me what you shared
# Makefile
NEWT_COLOR_PALETTE_DIALOGS="$(shell cat configs/whiptail-theme-green.cfg)"
WHIPTAIL_COLORED=export NEWT_COLORS=$(NEWT_COLOR_PALETTE_DIALOGS); whiptail
test:
$(WHIPTAIL_COLORED) \
--title "Alert" \
--msgbox "something to describe here" 10 50 \
2>&1 1>/dev/tty
# configs/whiptail-theme-green.cfg
root=green,black
border=green,black
title=green,black
roottext=white,black
window=green,black
textbox=white,black
button=black,green
compactbutton=white,black
listbox=white,black
actlistbox=black,white
actsellistbox=black,green
checkbox=green,black
actcheckbox=black,green
You can also use prettyfying config:
$ NEWT_MONO=1 whiptail ...
Or import themes by using NEWT_COLORS_FILE
:
$ NEWT_COLORS_FILE=path/to/theme_file.txt whiptail ...
NEWT_COLORS_FILE=<(cat <<EOF
root=white,gray
window=white,lightgray
border=black,lightgray
shadow=white,black
button=black,green
actbutton=black,red
compactbutton=black,
title=black,
roottext=black,magenta
textbox=black,lightgray
acttextbox=gray,white
entry=lightgray,gray
disentry=gray,lightgray
checkbox=black,lightgray
actcheckbox=black,green
emptyscale=,black
fullscale=,red
listbox=black,lightgray
actlistbox=lightgray,gray
actsellistbox=black,green
EOF
) whiptail \
--backtitle Backtitle \
--title Title \
--menu "$0" 0 0 2 1 One 2 Two 3 Three 4 Four
# zshrc
export NEWT_MONO=1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wow! it's amazing! :D thanks a lot