You are not logged in.
How should i understand the number (here "1")?
[
BLUE=`tput setf 1`
GREEN=`tput setf 2`
CYAN=`tput setf 3`
RED=`tput setf 4`
MAGENTA=`tput setf 5`
YELLOW=`tput setf 6`
WHITE=`tput setf 7`
PURPLE=`tput setf 9`
WHEAT=`tput setf 11`
DEFA=`tput setf 49`
DEFB=`tput setf 45`
PS1='\[$DEFA\]\A\[$DEFB\]\w\[$DEFA\]">\[$DEFB\] '
]
Is there any way to translate the number after "setf" to something comprehensible, like, RGB ??
the major purpose i wanna know this is that,
i have a color i wanna use in urxvt as output font color,
i know the color name, CornflowerBlue,
AND i know the RGB value, 100 149 237, or, #6495ED,
BUT,unfortunately, i don't know the "setf" value !
feels like a blind guy....lol
some light to guide?
thx
This silver ladybug at line 28...
Offline
It is all in
man terminfo
This is one of the hugest man pages I know of (around 2000 lines) and the information there is overwhelming.
Color values, including RGB, are around line 1770.
setf is "set foreground"
setb is "set background"
To know or not to know ...
... the questions remain forever.
Offline
It is all in
man terminfo
This is one of the hugest man pages I know of (around 2000 lines) and the information there is overwhelming.
Color values, including RGB, are around line 1770.
setf is "set foreground"
setb is "set background"
thanks, bernarcher! it is overwhelming...
i see the 0~7 chart there around 1770,
and i see it in /usr/include/curses.h
/* colors */
#define COLOR_BLACK 0
#define COLOR_RED 1
#define COLOR_GREEN 2
#define COLOR_YELLOW 3
#define COLOR_BLUE 4
#define COLOR_MAGENTA 5
#define COLOR_CYAN 6
#define COLOR_WHITE 7
while, on the other hand, i still dont get the point of it... i mean,
what about the `tput setf 65` ?
where is it defined, i still dont get it...
and i've tried those numbers around 70, 80 , 90 , there seems to be a limit to it, which i'm not sure about,
still feeling blind..as newbies normally do , lol..
bernarcher, and also somebody,
explain it to me , plz
This silver ladybug at line 28...
Offline
Can you not use .Xdefaults? That's where I set urxvt colours.
Offline
@Tomk
i do use .Xdefaults.
now i've renamed .bashrc to .bashrc.xx, then opened up a new urxvt window, it's nice that when i type in urxvt, the "URxvt.foreground" color is set to output font. it's nice since the font color coming out is finally predictable .... ==! lol
thx for that tip~ tomk!
while, still... since i've abandoned PS1 setting in .bashrc, SP1 looks now just plain: '$ bash-3.2: '
how can i get the PS1 set to my former style, using several colors, like ::
PS1='\[$colorA\]\A\[$colorB\]\w\[$colorC\]">\[$colorD\] '
.1 how to set PS1 to be like this using only .Xdefaults ?
.2 how to set PS1 to be like this using .Xdefaults to set colorD, and .bashrc to set colorA\B\C ?
.3 i'm still wondering if anyone here will feagure it out what 'setf 1' means, so that it's ok to just set it up in .bashrc ?
Last edited by lolilolicon (2009-03-06 08:18:13)
This silver ladybug at line 28...
Offline
You should still use .bashrc for your PS1. For fancy prompts, search the forum and/or google.
Offline