[Tfug] Changing xterm colors

Mike Martinet mmrtnt at earthlink.net
Mon Oct 16 10:48:03 MST 2006


>
>Message: 1
>Date: Fri, 13 Oct 2006 15:01:05 -0700
>From: "Matt Jacob" <matt.jacob at gmail.com>
>Subject: [Tfug] Changing xterm colors
>To: "Tucson Free Unix Group" <tfug at tfug.org>
>Message-ID:
>	<ca18f5360610131501w3d42d777k96d8ce6c0c8423e4 at mail.gmail.com>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>At work, I have access to a few boxes via SSH. One is running Red Hat,
>and one is running Gentoo. The RH box uses a really dark shade of blue
>for directories (when using ls --color) and also for comments in vim.
>My terminal background is black, so dark blue on black is nearly
>impossible to read. The Gentoo box uses a brighter shade of blue,
>which I can actually read against the black background.

*** Sorry, forgot to change subject line on previous reply ***

Well, the default background color for my xterm (on FC4) is white.  

Sounds like if you could use a white background, you'd solve half your problems right there.

xterm -bg white

You can change bash's directory listing colors by exporting a new LS_COLORS 
environment variable.  Here's the one I use with transparent Eterm's - it
lists directories in bright green:

export LS_COLORS='no=00:fi=00:di=01;32:ln=01;36:pi=40;34:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:
ex=01;33:*.tar=01;31:*.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:*.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:'

The dircolors program will dump the information needed to configure a new LS_COLORS
environment variable:

dircolors --print-database | more

Good Luck!

MjM


Okay, now that I'm reposting, here's what I forgot before, because it's been so long since I've done it.  (Once I got a LS_COLORS string I liked, I stuck with it)

dump the current color configuration to a file:

dircolors --print-database > newcolors.conf

edit the file:

vi newcolors.conf

read it carefully, and change/add the various file extensions and colors as you like

Then, use dircolors to print out a new LS_COLORS string:

dircolors newcolors.conf

You can change to your new colors on the fly with:

eval `dircolors newcolors.conf`

Once you get a combination you like, you can use dircolors to add the new LS_COLORS string to the end of .bash_profile in your home dir:

dircolors newcolors.conf >> .bash_profile  

*** Absolutely must use >> so you don't overwrite your .bash_profile ***


MjM




More information about the tfug mailing list