Subject: Re: How to change the wscons color?
To: None <netbsd-help@netbsd.org>
From: Beaker (aka Jeff W) <beaker@myrealbox.com>
List: netbsd-help
Date: 02/18/2003 19:25:28
Sung N. Cho wrote:
>
> How do I change the default wscons color? To change it, I am doing
in kernel config the following:
>
> options WS_KERNEL_FG=WSCOL_BLACK
> options WS_KERNEL_BG=WSCOL_WHITE
>
> But this only seem to change the message lines. What I was intending
to do was to change the whole screen background and foreground. For
example, make the whole screen background WHITE and every messages in BLACK.
I had this same desire a while back. The solution for me was to simply
add a series of if|elseif/thens and the appropriate ASCII escapes* to my
~/cshrc file. Below is an exerpt:
# This sets screen-specific colors based on tty
set scrn = (`/usr/bin/tty | /usr/bin/tail -c 2`)
if ( $scrn !~ [0-7] ) then
exit ; echo "There's a problem with tty - fix it!"
else if ( $scrn == 0 ) then
set prompt = "[37;40m$USER@${mch:q}: {\!} "
else if ( $scrn == 1 ) then
set prompt = "[32;40m$USER@${mch:q}: {\!} "
else if ( $scrn == 2 ) then
set prompt = "[33;40m$USER@${mch:q}: {\!} "
else if ( $scrn == 3 ) then
set prompt = "[36;40m$USER@${mch:q}: {\!} "
endif
#end of colors script
* many thanks to the kind soul who sent me a "color chart" of ASCII
escapes way back when!
Notes:
- The "" was made in vi with ^V ^[
- You really shouldn't use 'tail -c 2'. Use awk instead.
- IIRC, "37" = white, "32"=green, "33"=red, "36"=cyan, "40"=black
HTH,
Beaker