[NTLUG:Discuss] change terminal colors

Steve Jackson sjackson at stratmarkcorp.com
Tue Sep 4 16:38:28 CDT 2001


yeah, those color codes are the same ones I found to change the colors by
echoing escape sequences to the terminal.  However, how do they translate to
the terminfo entries???

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


At 04:04 PM 9/4/2001 -0500, you wrote:
>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?

check out
$ dircolor --print-database
# Configuration file for dircolors, a utility to help you set the
# LS_COLORS environment variable used by GNU ls with the --color option.

# The keywords COLOR, OPTIONS, and EIGHTBIT (honored by the
# slackware version of dircolors) are recognized but ignored.

# Below, there should be one TERM entry for each termtype that is
colorizable
TERM linux
TERM linux-c
TERM mach-color
TERM console
TERM con132x25
TERM con132x30
TERM con132x43
TERM con132x60
TERM con80x25
TERM con80x28
TERM con80x30
TERM con80x43
TERM con80x50
TERM con80x60
TERM xterm
TERM xterm-debian
TERM rxvt
TERM screen
TERM screen-w
TERM vt100

# Below are the color init strings for the basic file types. A color init
# string consists of one or more of the following numeric codes:
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
NORMAL 00       # global default, although everything should be something.
FILE 00         # normal file
DIR 01;34       # directory
LINK 01;36      # symbolic link
FIFO 40;33      # pipe
SOCK 01;35      # socket
BLK 40;33;01    # block device driver
CHR 40;33;01    # character device driver
ORPHAN 40;31;01 # symlink to nonexistent file

# This is for files with execute permission:
EXEC 01;32

# List any file extensions like '.gz' or '.tar' that you would like ls
# to colorize below. Put the extension, a space, and the color init string.
# (and any comments you want to add after a '#')

# If you use DOS-style suffixes, you may want to uncomment the following:
#.cmd 01;32 # executables (bright green)
#.exe 01;32
#.com 01;32
#.btm 01;32
#.bat 01;32

.tar 01;31 # archives or compressed (bright red)
.tgz 01;31
.arj 01;31
.taz 01;31
.lzh 01;31
.zip 01;31
.z   01;31
.Z   01;31
.gz  01;31
.bz2 01;31
.deb 01;31
.rpm 01;31

# image formats
.jpg 01;35
.png 01;35
.gif 01;35
.bmp 01;35
.ppm 01;35
.tga 01;35
.xbm 01;35
.xpm 01;35
.tif 01;35
.png 01;35
.mpg 01;35
.avi 01;35
.fli 01;35
.gl 01;35
.dl 01;35
>-----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
>
>_______________________________________________
>http://www.ntlug.org/mailman/listinfo/discuss

--
MadHat at unspecific.com

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




More information about the Discuss mailing list