Linux Customize Colors in linux

Status
Not open for further replies.

el33t

Explorer
What i mean is how to customize the "Ok" & "Failed" text and also the default green and red color. Also how to change the various file types and directories color when u use the ls command:

Well here howto:
Considering Fedora linux

* Change Ok & Failed text search this file:
vi /etc/init.d/functions

* Change the color of Ok & Failed:
vi /etc/sysconfig/init

* Now here is problem i do not understand when changing the color of file types:
The command to see the default colors is:

dircolors -p

Now what i understand is we have to alter the LS_COLORS environment variable so this is how u do:

dircolors -p > /colors ;chmod +x /colors
vi /colors to edit the color scheme
dircolors /colors

Should i add some entry in .bashrc with setenv?
and it will temporarily change the color. Also there is a file ~/.dircolors but doesn't work. How to do it permanent?

Regards.
 
archish said:
I think in Konsole u can change in preferences :)

ahh my friend not konsole color scheme which only changes the background and text colors.
I am talking about the file(symbolic links,audio,zip,video files,script filesetc.) folders etc color which is decided by LS_COLORS environment variable run the dircolors command to see :)

Regards.
 
well here is the step to change for ls output:
You will notice that there are default colors in directory listings for certain types of files; executables are green, directories are dark blue, symbolic links are light blue. This is accomplished by the line alias ls "ls -CF --color=tty" in the system /etc/csh.cshrc file. If you don't want any colors at all, either place the line "unalias ls" in your $HOME/.cshrc-linux-$user file (create the file if you don't have it), or redefine an alias for ls to list things the way you want, e.g. alias ls "ls -F" To modify the colors, you need to set the LS_COLORS environment variable.

just picked up while googling

ls

Here's my favorite alias for ls

$ alias ls='ls -AxFqsh --color'

You can set default colors with the variable LS_COLORS by putting the command eval `dircolors` in a login file. To see more about defaults type dircolors --print-database. I don't like dark blue for directories, so I set them to cyan with

$ export LS_COLORS="no=00:fi=00:di=01;36:ln=01;34: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:*.jar=01;31:*.zip=01;31:\
*.z=01;31:*.Z=01;31:*.gz=01;31:"

Attribute codes are 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed, text color codes are 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white, and background color codes are 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white. Here are the some useful types:

no: normal, global default, although everything should be something.
fi: normal file
di: directory
ln: symbolic link
pi: FIFO, pipe
so: socket
bd: block device driver
cd: character device driver
or: orphan, symlink to nonexistent file
ex: files with execute permission
 
yup thats it thanks. added the LS_COLORS variable in ~/.bashrc and it works. I keep forgetting the escape "\" character damn

export LS_COLORS="no=00:fi=00:di=01;35:ln=01;34: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:*.jar=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:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:\
*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:\
*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:\
*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:\
*.mp3=01;35:*.wav=01;35:"
Regards.
 
Status
Not open for further replies.