Try out this bash function in the console. Fittingly, it doesn't work in an X terminal (I think because of the tabs). Especially check out the three files used last, namely
/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"
}
Edit in response to comment
For example, change the second digit in the green file (sys/module/vt/parameters/default_grn
) to 170
- this will give the second color (with index 1) as much green as red, and no blue (at least in my case, because I have the corresponding digit in default_red
170
, and 0
in default_blu
).
Now, type tput setaf 1; echo hi
. Here you put the foreground color to the color with index 1 (the one you changed), then you print it. (Note the oneliner with a colon to separate the commands, else your prompt may reset the tput
in between.)
If it appears the same as always, try echo -n '\033]R'
and then the tput
line again. Now, both "hi"s should be sort of yellow.
Let my know if you get it to work (or not).