[NTLUG:Discuss] change terminal colors

Steve Jackson sjackson at stratmarkcorp.com
Tue Sep 4 16:04:42 CDT 2001


Actually, I guess I should have been more clear on this.  You're right it's
not a Linux-vs-SCO issue.  It's a 'making the transition from SCO to Linux
seemless to the user' issue.

Anyway, my only color changing needs relate to the character based terminal
(and virtual terminals) ONLY.  I believe I have found a way to accomplish
the color change from within the terminfo file.  However, I'm not sure about
the format the capabilities' values take.  I can get the terminfo src
(infocmp) and I can compile it (tic), however I'm not sure how to set the
colors.  I know the capnames are:

setab (for background)
setaf (for foreground)

Here's how they appear in the 'linux' terminal:

setab=\E[4%p1%dm
setaf=\E[3%p1%dm

I'm not sure how to decipher these values.  I'm assuming '\E[3%p1%dm' is
white, but how can I deduce what values the other colors would require.  A
web search has come up with nada.  Little help?

-----Original Message-----
From: discuss-admin at ntlug.org [mailto:discuss-admin at ntlug.org]On Behalf
Of Richard Cobbe
Sent: Tuesday, September 04, 2001 3:48 PM
To: discuss at ntlug.org
Subject: RE: [NTLUG:Discuss] change terminal colors


Lo, on Tuesday, September 4, Steve Jackson did write:

> good points.  Unfortunately, in some instances using Linux as a
replacement
> *nix requires that Linux be able to conform to the way an old *nix
operated
> (or appeared to operate).  In my case, my boss (a long time SCO user) has
> finally agreed to start using Linux in production.  However, this is
> dependant upon Linux being able to replace (seemlessly to the user) SCO.
> Hence, the terminal color requirements (and printing, and some other
stuff).

So far as I know, it's not actually a Linux-vs-SCO issue, it's a desktop
program issue.  Ferinstance, most folks at work use Solaris/CDE, and CDE
provides a similar setting which affects all *CDE* applications, as well as
certain other ones.  However, on the relatively rare occasions I log in at
the console of my Sparc machine, I don't use CDE; I just fall back on plain
old fvwm2.  CDE's setting doesn't apply, and I'm back to the
per-application stuff again.

Several notes:

1) Easiest way, especially if you want complete transparency to the user:
   figure out which desktop suite (CDE, etc.) that you're using on SCO, and
   get a copy for Linux.

2) Failing that, you might look into the Linux desktop suites and see if
   they have a standard setting for this sort of thing; I think GNOME
   themes might address this issue.

   I don't use either GNOME or KDE, so I can't say for sure.

3) It sort of sounds to me like you're running console apps within a
   terminal window, like xterm.  You *can* set your xterm colors once and
   for all, and any applications run within an xterm will inherit these as
   a starting point.  GNU ls will still colorize, but unless you
   specifically override (e.g.) the background, it'll still use xterm's
   default.  (And yes, it does reset the terminal back to defaults when it
   finishes.)

   Obviously, the way to do this will differ depending on exactly which
   terminal program you use: xterm, rxvt, eterm, etc.  For straight xterm,
   shove the following into your X resource list:

        xterm*foreground:               cornsilk
        xterm*background:               midnightblue

   At least, those are the colors I use; I find they're easy on my eyes.
   To get a list of all of the known color names, use gcolorsel or
   xcolorsel.  If the color you want doesn't correspond to a pre-defined
   color name, then you can specify it in the form #xxyyzz, where xx, yy,
   and zz are the red, green, and blue values, respectively, expressed as
   hexadecimal numbers between 00 and FF.

   Of course, this won't affect applications that you don't run in an
   Xterm, like Netscape or Emacs (in its own top-level window); you're back
   to per-application configurations there.

> I thought Linux was the 'best', 'most configurable' OS out there.

Having this configuration option spread over multiple applications does not
preclude Linux being the `most configurable' OS.  Personally, I *like*
having the flexibility to set my xterms as above and my emacsen in a
different color scheme.  YMMV.

Richard
_______________________________________________
http://www.ntlug.org/mailman/listinfo/discuss




More information about the Discuss mailing list