LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 07-07-2008, 08:54 AM   #1
jsmith6
Member
 
Registered: Feb 2006
Distribution: Slackware 13.1 / 13.37
Posts: 91

Rep: Reputation: 16
I can't change xterm's colors (with Xresources)


I am trying to set custom colors in Xterm via the file ~/.Xresources but Xterm doesn't respond. Here is what Xresources contains:

Code:
XTerm*color0: rgb:0/0/0
XTerm*color1: rgb:cc/00/00
XTerm*color2: rgb:00/cc/00
XTerm*color3: #bd5e01
XTerm*color4: rgb:00/00/cc
XTerm*color5: rgb:cc/00/cc
XTerm*color6: rgb:00/cc/cc
XTerm*color7: rgb:aa/aa/aa
XTerm*color8: rgb:33/33/33
XTerm*color9: rgb:ff/00/00
XTerm*color10: rgb:00/ff/00
XTerm*color11: rgb:ff/ff/00
XTerm*color12: rgb:00/00/ff
XTerm*color13: rgb:ff/00/ff
XTerm*color14: rgb:00/ff/ff
XTerm*color15: rgb:ff/ff/ff
Xterm responds only to those two:

Code:
!xterm*background: black
!xterm*foreground: grey
How can I set my Xterm colors?

I don't mind if it's going to be another way than editing Xresources. If Xterm cannot change colors, I am open to suggestions on another terminal that will allow me to do so (along with changing the font to something smooth like DejaVu Sans Mono).
 
Old 07-08-2008, 06:54 AM   #2
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 38
It should work fine, that's how my xterm settings are loaded too. And the lines starting with ! ought to be comments, so those definitely shouldn't be responded to. Did you remember to run xrdb to refresh the changes? Otherwise changes will be visible only when restarting X.
Code:
xrdb -merge ~/.Xdefaults
(I think that's the right command).
 
Old 07-08-2008, 08:06 AM   #3
jsmith6
Member
 
Registered: Feb 2006
Distribution: Slackware 13.1 / 13.37
Posts: 91

Original Poster
Rep: Reputation: 16
These two options do work:

Code:
xterm*background: black
xterm*foreground: grey
In my first post, I mistakenly left the "!" in (which are comments of course). I do run xrdb -merge ~/.Xdefaults after each change I do. I tried it again but this time I restarted X. Nothing changed.

I tried out setting colors in Hex instead of RGB but again it didn't worked (note that these are random colors, I just created them with Gcolor2 to test whether Xterm will respond):

Code:
xterm*background: black
xterm*foreground: grey
xterm*color0: #8EB327
xterm*color1: #27B3A8
xterm*color2: #A6F097
xterm*color3: #F0C497
xterm*color4: #D997F0
xterm*color5: #767FA6
xterm*color6: #76A2A6
xterm*color7: #76A67F
Does it work on your Slackware 12.1 x86? Can you paste me here your color configuration, perhaps I messed up these colors somewhere.

If it's working on your system then maybe I messed some other configuration file? I don't know...
 
Old 07-08-2008, 08:22 AM   #4
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 38
Mine's Slackware too, but not x86. I appended your configs to my file, it works fine in my machine. See a snapshot.
Couple of things: you might want to symlink .Xdefaults and .Xresources just to be sure. Also, I've defined those lines as XTerm*color0 instead of xterm*color0, but your way works for me too.
I've uploaded my .Xdefaults here, in case it helps.
 
Old 07-08-2008, 08:38 AM   #5
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
Maybe there are overriden by something in app-defaults ?

locate app-defaults
Should be in /etc/X11/app-defaults/Xterm
 
Old 07-10-2008, 04:42 AM   #6
cmk77
Member
 
Registered: May 2006
Location: netherlands
Distribution: slackware, centos, scientificlinux
Posts: 119

Rep: Reputation: 24
maybe you have an empty space at the end of each line? I remember that Xresources is sensitive to that. "#76A67F" is fine, but "#76A67F " is not.
 
Old 07-12-2008, 02:56 PM   #7
jsmith6
Member
 
Registered: Feb 2006
Distribution: Slackware 13.1 / 13.37
Posts: 91

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by arungoodboy View Post
Mine's Slackware too, but not x86. I appended your configs to my file, it works fine in my machine. See a snapshot.
Couple of things: you might want to symlink .Xdefaults and .Xresources just to be sure. Also, I've defined those lines as XTerm*color0 instead of xterm*color0, but your way works for me too.
I've uploaded my .Xdefaults here, in case it helps.
Do you have an IBM System Z?! :-P Just kidding. But out of curiocity, what are you running Slackware on?

Thanks for the screenshot, I never doubted that it worked for you though! :-D Is this fvwm2? Nice theme!

I symlinked .Xdefaults to .Xresources. Nothing changed. Then I removed .Xresources and kept just .Xdefaults. Again, nothing. I tried your Xdefaults (exactly as you have it on pastebin) but again, no change.

Quote:
Originally Posted by nx5000 View Post
Maybe there are overriden by something in app-defaults ?

locate app-defaults
Should be in /etc/X11/app-defaults/Xterm
Hm.. I thought that the options in home override any of these defaults. Nevertheless, I tried moving the whole /etc/X11/app-defaults directory to /tmp and then restarted X, but nothing happened.

Quote:
Originally Posted by cmk77 View Post
maybe you have an empty space at the end of each line? I remember that Xresources is sensitive to that. "#76A67F" is fine, but "#76A67F " is not.
I checked that one too, but there is no empty space there. I was curious, so I tried this: I placed an empty espace in "xterm*background: black " (which is one of the options that work on me) and it still worked. Does it disable the color/option if you put a space there on your machine?

It would be nice if someone with x86 Slackware could confirm that the colors of Xterm can be changed (you can test any of the configurations that me or the rest posted in this topic).
 
Old 07-12-2008, 11:39 PM   #8
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 38
By x86 do you mean x86-64? That's the conclusion I jumped to and I now see x86 also refers to normal i[3-6]86 families. My slackware runs on a 32 bit Pentium dual core.
Code:
arun ~ $ uname -a
Linux ares 2.6.24.5-smp #2 SMP Wed Apr 30 13:41:38 CDT 2008 i686 Intel(R) Pentium(R) D CPU 3.00GHz GenuineIntel GNU/Linux
arun ~ $
The WM is Ion3 (see my sig!)
I've kinda run out of ideas here. You could make a deliberate typo in your .Xdefaults, and see whether or not xrdb actually parses the file when you run the merge command. I usually get warnings like 'unterminated single quote'.
 
Old 07-13-2008, 06:09 AM   #9
cmk77
Member
 
Registered: May 2006
Location: netherlands
Distribution: slackware, centos, scientificlinux
Posts: 119

Rep: Reputation: 24
Quote:
I checked that one too, but there is no empty space there. I was curious, so I tried this: I placed an empty espace in "xterm*background: black " (which is one of the options that work on me) and it still worked. Does it disable the color/option if you put a space there on your machine?
It does work for the color but gives warnings:
Code:
bash-3.1$ xterm -bg "black " -fg "white" -fn "10x20"
Warning: Color name "black " is not defined
For the font it does not work:
Code:
bash-3.1$ xterm -bg "black" -fg "white" -fn "10x20 "
xterm:  unable to open font "10x20 ", trying "fixed"....
 
Old 07-13-2008, 11:50 AM   #10
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,746

Rep: Reputation: 458Reputation: 458Reputation: 458Reputation: 458Reputation: 458
Try using 'gray99' as the color -I thinkl that was what it was when I ran into this problem with some other program.
 
Old 07-20-2008, 08:53 PM   #11
jsmith6
Member
 
Registered: Feb 2006
Distribution: Slackware 13.1 / 13.37
Posts: 91

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by arungoodboy View Post
The WM is Ion3 (see my sig!)
I've kinda run out of ideas here. You could make a deliberate typo in your .Xdefaults, and see whether or not xrdb actually parses the file when you run the merge command. I usually get warnings like 'unterminated single quote'.
I did. Erm.. Ion3 looks a bit too "hack-ish" for me, and I yearn for the lazyness of Xfce :P

I tried making a deliberate mistake on Xresources and xrdb found it.

Quote:
Originally Posted by gnashley View Post
Try using 'gray99' as the color -I thinkl that was what it was when I ran into this problem with some other program.
I tried putting all colors (except background and foreground) as grey99, like this:

Code:
xterm*background: black
xterm*foreground: grey
xterm*color0: gray99
xterm*color1: gray99
xterm*color2: gray99
xterm*color3: gray99
xterm*color4: gray99
xterm*color5: gray99
xterm*color6: gray99
xterm*color7: gray99
But it didn't worked.

Then I found some color codes for xterm and tried again the same with PapayaWhip, like this:

Code:
xterm*background: black
xterm*foreground: grey
xterm*color0: PapayaWhip
xterm*color1: PapayaWhip
xterm*color2: PapayaWhip
xterm*color3: PapayaWhip
xterm*color4: PapayaWhip
xterm*color5: PapayaWhip
xterm*color6: PapayaWhip
xterm*color7: PapayaWhip
It didn't worked either.

I think I am doing something wrong on my side because also tried a few Xresources from the ones that we posted on this topic on Slax 6.0.3 (a LiveCD) and Xubuntu 7.10 (running as LiveCD) and again it didn't worked! (always running xrdb of course).

This... can't be. Not working on 3 different distributions (although Slax is based on Slackware). I am going to download and try it on Knoppix, Fedora liveCD and then FreeSBIE. I will post the results.

In any case, thanks a lot guys!
 
Old 07-21-2008, 02:13 PM   #12
Stroker
Member
 
Registered: Dec 2006
Location: The Nature Coast
Distribution: Slackware 01001101
Posts: 83

Rep: Reputation: 18
Well, in Slackware it's call from /etc/X11/xinit/xinitrc

Code:
userresources=$HOME/.Xresources

if [ -f $userresources ]; then
    xrdb -merge $userresources
fi
Something wrong with your HOME env var?
File perms?
Starting X in an unusual way?

Just some thoughts.
 
Old 07-21-2008, 06:20 PM   #13
jsmith6
Member
 
Registered: Feb 2006
Distribution: Slackware 13.1 / 13.37
Posts: 91

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by Stroker View Post
Well, in Slackware it's call from /etc/X11/xinit/xinitrc

Code:
userresources=$HOME/.Xresources

if [ -f $userresources ]; then
    xrdb -merge $userresources
fi
Something wrong with your HOME env var?
File perms?
Starting X in an unusual way?

Just some thoughts.
ls -lh ~/.Xresources gives me:

Code:
-rw-r--r-- 1 jsmith users 1.1K 2008-07-21 04:47 .Xresources
This one looks ok.

I had this curstom alias to start X in 96 DPI:

Code:
alias startx='startx -- -dpi 96'
I removed it from /etc/profile.d/coreutils-dircolors.sh, loged out, then loged in again and started X. No change. Is this what you mean with "unusual way"?

My HOME env var seems ok:

Code:
echo $HOME
/home/jsmith
 
Old 07-21-2008, 08:43 PM   #14
Stroker
Member
 
Registered: Dec 2006
Location: The Nature Coast
Distribution: Slackware 01001101
Posts: 83

Rep: Reputation: 18
Have you tried to query the X resources db to see if your entries made it in?

xrdb -query | grep XTerm
 
Old 07-22-2008, 03:24 AM   #15
jsmith6
Member
 
Registered: Feb 2006
Distribution: Slackware 13.1 / 13.37
Posts: 91

Original Poster
Rep: Reputation: 16
Since it's not very lengthy, here is my whole xrdb -query:

Code:
XTerm*background:	black
XTerm*color0:	PapayaWhip
XTerm*color1:	PapayaWhip
XTerm*color2:	PapayaWhip
XTerm*color3:	PapayaWhip
XTerm*color4:	PapayaWhip
XTerm*color5:	PapayaWhip
XTerm*color6:	PapayaWhip
XTerm*color7:	PapayaWhip
XTerm*foreground:	grey
Xft.hinting:	1
Xft.hintstyle:	hintmedium
xterm*background:	black
xterm*color0:	PapayaWhip
xterm*color1:	PapayaWhip
xterm*color2:	PapayaWhip
xterm*color3:	PapayaWhip
xterm*color4:	PapayaWhip
xterm*color5:	PapayaWhip
xterm*color6:	PapayaWhip
xterm*color7:	PapayaWhip
xterm*faceName:	Monospace:size=11
xterm*foreground:	grey
When I read your post, I changed back from "xterm*color..." to "XTerm*color..." just in case it made any difference. I guess this is why we see both the "xterm" entries and the "XTerm" entries. I have set all the colors to "PapayaWhip" so that it will become obvious when it starts working.
 
  


Reply

Tags
color, vt100, xterm


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to change colors of ls listing? learnfast Linux - Newbie 11 12-01-2012 09:03 AM
change folder colors JUbuntu Linux - Newbie 1 03-31-2008 05:57 AM
How to change screen colors lewisdw Linux - Newbie 1 08-12-2004 06:58 AM
How do you change the colors in emacs? ArmedCoder Linux - Software 1 10-26-2003 07:12 PM
how do i change text colors rcjoyner Linux - Newbie 3 10-16-2003 11:05 AM


All times are GMT -5. The time now is 11:32 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration