I tried xterm -fg gray and xterm -fg grey but both gave Warning: color name... is not defined.

I am on ubuntu and there is no rgb.txt in /etc/X11/rgb.txt

How can I launch xterm with custom fg/bg colors? (specific rgb values).



You can find a copy of the file here.

You can also add this line to ~/Xdefaults:

xterm*foreground:   gray
  • Thanks. Is there an alternative if one doesnt have root access? – jp19 Feb 19 '11 at 5:51
  • actually, for now, I have root access. I copied the file, but it still does not recognize the color definitions in rgb.txt – jp19 Feb 19 '11 at 5:54
  • @jp19: Please see my edited answer. – Paused until further notice. Feb 19 '11 at 6:07

Xorg no longer uses rgb.txt for color names, but builds the color database into the X server when it's built. The rgb.txt built into the X server comes from the app/rgb module upstream, and the upstream version can be viewed in their git viewer.

To specify colors by value, see the "COLOR NAMES" section of the X(7) man page. For instance, these should each be gray:

xterm -bg rgb:80/80/80
xterm -bg '#808080'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.