Skip to content

Instantly share code, notes, and snippets.

@xnox
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xnox/522d334323cea70739ad to your computer and use it in GitHub Desktop.
Save xnox/522d334323cea70739ad to your computer and use it in GitHub Desktop.
console colors
##source http://unix.stackexchange.com/questions/73807/change-colors-in-console-virtual-terminal
/sys/module/vt/parameters/default_red
/sys/module/vt/parameters/default_grn
/sys/module/vt/parameters/default_blu
clr () {
clear # GFX bug otherwise
setterm -regtabs 4
Color_names="bla red gre yel blu mag cya whi"
Color_arr=($Color_names)
tput setaf 4
tput setab 7
echo -n " normal "
tput sgr0
echo -n " "
tput setaf 7
tput setab 4
echo " bright "
tput sgr0
for cmd in sgr0 bold
do
tput $cmd
for m in 0 1 2 3 4 5 6 7
do
tput setaf $m
echo -n ${Color_arr[$m]}" "
done
done
echo
tput sgr0
cat /sys/module/vt/parameters/default_red \
/sys/module/vt/parameters/default_grn \
/sys/module/vt/parameters/default_blu | sed s/,0/", "/g | \
sed s/^0/" "/g | \
tr "," "\t"
}
if [ "$TERM" = "linux" ]; then
echo -en "\e]P0222222" #black -> this is the background color as well.
echo -en "\e]P8222222" #darkgray
echo -en "\e]P1803232" #darkred
echo -en "\e]P9982b2b" #red
echo -en "\e]P25b762f" #darkgreen
echo -en "\e]PA89b83f" #green
echo -en "\e]P3aa9943" #brown
echo -en "\e]PBefef60" #yellow
echo -en "\e]P4324c80" #darkblue
echo -en "\e]PC2b4f98" #blue
echo -en "\e]P5706c9a" #darkmagenta
echo -en "\e]PD826ab1" #magenta
echo -en "\e]P692b19e" #darkcyan
echo -en "\e]PEa1cdcd" #cyan
echo -en "\e]P7ffffff" #lightgray
echo -en "\e]PFdedede" #white -> this is the foreground color as well.
clear #for background artifacting
fi
vt.default_red=0x07,0xdc,0x85,0xb5,0x26,0xd3,0x2a,0xee,0x00,0xcb,0x58,0x65,0x83,0x6c,0x93,0xfd vt.default_grn=0x36,0x32,0x99,0x89,0x8b,0x36,0xa1,0xe8,0x2b,0x4b,0x6e,0x7b,0x94,0x71,0xa1,0xf6 vt.default_blu=0x42,0x2f,0x00,0x00,0xd2,0x82,0x98,0xd5,0x36,0x16,0x75,0x83,0x96,0xc4,0xa1,0xe3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment