You are not logged in.

#1 2011-12-27 17:09:49

FernandoBasso
Member
From: Brazil
Registered: 2010-10-27
Posts: 89
Website

Understanding Xdefault terminal colors (SOLVED)

I want to understand what does color1, color2, etc mean when configuring xterm in ~/.Xdefaults (or ~/.Xresources). For example, what will color2 display? If I set color2 to be red, what will be red in xterm?

Is there any specific documentation to read about this subject?

Here's my ~/.Xdefaults and ~/.bashrc, just in case...

http://snipt.net/FernandoBasso/xdefaults/
http://snipt.net/FernandoBasso/my-bashrc-dec-26-2011

Last edited by FernandoBasso (2011-12-27 18:20:44)


There is a difference between knowing the path and walking the path.

Offline

#2 2011-12-27 17:24:38

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Offline

#3 2011-12-27 17:25:55

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 26,882
Website

Re: Understanding Xdefault terminal colors (SOLVED)

I don't know about detailed documentation, but you can see this thread for some details.

Edit: deleted redundant info already in Karol's post.

Last edited by Trilby (2011-12-27 17:26:55)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2011-12-27 17:37:17

FernandoBasso
Member
From: Brazil
Registered: 2010-10-27
Posts: 89
Website

Re: Understanding Xdefault terminal colors (SOLVED)

Yes, I have.

Yes, I have.

I just didn't find anything relating to what each color1, color2, colorN means. The only ones that make sense is XTerm*foreground and XTerm*background. They will affect the text and the background, of course. But what about the others? I set a color I like, but I don't know what will the color be applied to.

For example,  XTerm*color2: red makes my PS1 prompt show red for \d and \t, but I don't see how can I know it will match \d and \t.

PS1='${hr::COLUMNS}\r\n\[\e[1;32m\]\s-\v, \[\e[0;32m\]\h@\u, \d \t \n\$PWD=\[\e[1;34m\]"\w" \[\e[0;32m\] \n\$ \[\e[0;35m\]'

EDIT: Reading this post, and trying the script to show colors (almost at the end of the post),
http://www.bashguru.com/2010/01/shell-c … ripts.html

I see, for example, that changing value of color0 I change the background of the first column shown by the script. But what is the relation?

Last edited by FernandoBasso (2011-12-27 17:53:04)


There is a difference between knowing the path and walking the path.

Offline

#5 2011-12-27 18:14:50

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 26,882
Website

Re: Understanding Xdefault terminal colors (SOLVED)

Color0 and Color8 set the specific color used for shell color 30 (eg "\e[30m" and "\e[30;1m")
Color1 and Color9 set shell color 31 (eg "\e[31m" and "\3[31;1m")
Color2 and Color10 set shell color 32, etc.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2011-12-27 18:20:07

FernandoBasso
Member
From: Brazil
Registered: 2010-10-27
Posts: 89
Website

Re: Understanding Xdefault terminal colors (SOLVED)

Trilby wrote:

Color0 and Color8 set the specific color used for shell color 30 (eg "\e[30m" and "\e[30;1m")
Color1 and Color9 set shell color 31 (eg "\e[31m" and "\3[31;1m")
Color2 and Color10 set shell color 32, etc.

That makes sense. Thanks. (SOLVED).

Last edited by FernandoBasso (2011-12-27 18:20:26)


There is a difference between knowing the path and walking the path.

Offline

Board footer

Powered by FluxBB