[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mor on cheeplinux...



On Sat, Apr 01, 2000 at 11:19:22AM +0100, Ian Wright wrote:
> Hi,
> ----- Original Message -----
> From: Alastair Donlon <adonlon [at] netsoc.ucd.ie>
> 
> > /etc/DIR_COLORS holds the dope on the colours 'ls' gives you.
> 
> I found this and changed the colour designations but it doesn't seem to have
> changed anything in the real world, even after a reboot! Is there something
> I am still missing? There is a line in the file which says that it can be
> copied as .dir_colors to the $HOME directory - this terminology confuses me
> a bit - I have copied it to /home/ian directory - is that what it meant?
> Thanks,
> 

Hmm, I really should try and remember the stuff that I've done to get things
working. First off, 'ls' gets the various colours that it should display
things in from an environment variable (LS_COLORS). The syntax to this variable
is pretty silly, and it's quite long and boring, so there's a program to
generate the command to set it. The name of the program is 'dir_colors'.
If you run dir_colors from the command line you'll get an output something
like :

LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.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:*.deb=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.mpg=01;37:*.avi=01;37:*.gl=01;37:*.dl=01;37:';
export LS_COLORS

What used to happen was that /etc/profile contains a command of the form

eval `dircolors`

or something a bit more complicated, such as

COLORS_FILE=/etc/DIR_COLORS
if [ -f ~/.dir_colors ]
then
	COLORS_FILE=~/.dir_colors
fi
eval `dircolors $COLORS_FILE`

which just makes /etc/DIR_COLORS the default file, unless a .dir_colors 
exists in the users home directory. Unfortunately, nowadays, that doesn't
always find its way into /etc/profile and 'ls' gives you the default colours.
If it ain't in your systemwide login script, then you just have to put it
into your personal one '~/.profile'.

Note the output of dircolors can be changed to be csh friendly as well. In
this case the same sort of thing goes into /etc/csh.cshrc or /etc/chs.login
or whatever.

The long and the short of it is:

1. To change the colours you need to mess about in either /etc/DIR_COLOURS
   or some other file containing the same syntax.

2. For the changes to take effect you need to run dircolors on that file.


Phew, what a trip down memory lane ;) It's been ages since I worked my way
through that little lot.

A.D.

---------------------------------------------------------------------
Sheffield Linux User's Group - http://www.sheflug.co.uk
To unsubscribe from this list send mail to
- <sheflug-request [at] vuw.ac.nz> - with the word 
 "unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.