You are not logged in.

#1 2010-11-18 06:23:08

kismet010
Member
Registered: 2009-09-02
Posts: 137

[solved] tty colors

Hi,

I want to set default colors to my console (tty, no X11 terminal emulators). I've got uvesafb. This is my .bashrc

PS1='\[\e[0;32m\]\w\[\e[0m\] '
if [ "$TERM" = "linux" ]; then
    echo -en "\e]P0000000" #black
    echo -en "\e]P8333333" #darkgrey
    echo -en "\e]P1432424" #darkred
    echo -en "\e]P9482727" #red
    echo -en "\e]P21C341C" #darkgreen
    echo -en "\e]PA203C20" #green
    echo -en "\e]P33C4013" #darkyellow
    echo -en "\e]PB444815" #yellow
    echo -en "\e]P4212F3E" #darkblue
    echo -en "\e]PC253546" #blue
    echo -en "\e]P5322A39" #darkmagen4ta
    echo -en "\e]PD3A3042" #magenta
    echo -en "\e]P6111B1B" #darkcyan
    echo -en "\e]PE1D302E" #cyan
    echo -en "\e]P7555555" #lightgrey
    echo -en "\e]PF777777" #white
    clear #for background artifacting
fi
export TERM="rxvt-256color"
export EDITOR="vim"
export VISUAL="vim"
export HISTSIZE=10000
export HISTFILESIZE=${HISTSIZE}
export BROWSER="w3m '%s' &"
shopt -s extglob
shopt -s cdspell
shopt -s checkwinsize
shopt -s cmdhist
complete -cf sudo
complete -cf man
complete -cf k

The idea is to set a #333333 (darkgrey) color to be the default foreground color. I'm trying combinations with the PS1 end color (I mean the [\e[0m\]) but when I open any app default color is lightgrey.

So, how can I set (without typing setterm any reboot) the default foreground color for my console?

Last edited by kismet010 (2010-12-14 11:11:31)

Offline

#2 2010-11-18 18:03:47

kinhodder
Member
From: UK
Registered: 2010-04-18
Posts: 65
Website

Re: [solved] tty colors

You can use setterm in /etc/inittab. Here's what I have in mine:

c1:2345:respawn:/sbin/agetty -I `setterm -clear all -background white -foreground black -bold -store` -8 38400 tty1 linux
c2:2345:respawn:/sbin/agetty -I `setterm -clear all -background white -foreground black -bold -store` -8 38400 tty2 linux

Offline

#3 2010-11-18 22:31:44

kismet010
Member
Registered: 2009-09-02
Posts: 137

Re: [solved] tty colors

with setterm I can only set 16 colors and I want a default #333333 foreground color for my framebuffer. Isn't there a way to set bash default color?

Last edited by kismet010 (2010-11-19 02:03:55)

Offline

#4 2010-12-14 11:11:10

kismet010
Member
Registered: 2009-09-02
Posts: 137

Re: [solved] tty colors

I got it, after a hard search.. just adding [8] to the end of the prompt, it makes store as default colors

Offline

Board footer

Powered by FluxBB