Jump to content

shell colours


Recommended Posts

When I first installed mandrake and opend a shell (usually konsole) different types of file would appear in different colours - directories blue, executables in green etc...

 

For some reason this is no loner the case - can anyone ive me any tips as to how to restore this?

It's as it was when I am logged in via su, but not a normal user

Link to comment
Share on other sites

Do a little search on this board because I remember answering a similar question here... or was the old board... don't know.

 

give a try to "search" and if you find nothing, I'll be glad to help you tonight (i'm in a hurry now)

Link to comment
Share on other sites

man ls. there is an option there that inlcudes the coloring scheme. ls is usually aliased to that but either something has changed in your system configuration (/etc/profile or in on of the .sh files called in it) or you have aliased ls with another set of options in your ~/.bash_profile or in your ~/-bashrc.

 

sorry, i dont have a linux machine right now or ill post it right on.

 

ciao!

Link to comment
Share on other sites

I have looked at my /etc/profile and I have searched the forum and neither has fixed this (although I did figure out how to improve my bash prompt :mystismiles: )

 

A little while ao - my .bashrc seemed to have disappeared altogether - so my current .bashrc is one I have put together to re-enable Java etc... - it contains very little. I'm not sure what happened to the original file though.

 

It has just occured to me to see if there is a clue in root's .bashrc (assumin there is one) - I'll post on my progress

Link to comment
Share on other sites

You have two files in /etc/profile.d:

 

color ls.csh:

# color-ls initialization

set COLORS=/etc/DIR_COLORS

eval `dircolors -c /etc/DIR_COLORS`

test -f ~/.dircolors && eval `dircolors -c ~/.dircolors` && set COLORS=~/.dircolors

test -f ~/.dir_colors && eval `dircolors -c ~/.dir_colors` && set COLORS=~/.dir_colors



egrep -qi "^COLOR.*none" $COLORS



if ( $? != 0 ) then

alias ls 'ls --color=tty'

endif

 

and

 

color ls.sh:

#!/bin/bash

eval `dircolors --sh /etc/DIR_COLORS`



# default ls options

LS_OPTIONS="-F"



# this should be removed once the bug with ls and multibytes locales is fixed

[ -r /etc/profile.d/lang.sh ] && . /etc/profile.d/lang.sh

case "$LC_ALL$LC_CTYPE" in

ja*|ko*|zh*) LS_OPTIONS="$LS_OPTIONS --show-control-chars";;

*) if [ "`locale charmap`" = "UTF-8" ]; then

 LS_OPTIONS="$LS_OPTIONS --show-control-chars"

   fi;;

esac



# emacs doesn't support color

if [ $TERM != "emacs" ];then

LS_OPTIONS="$LS_OPTIONS --color=auto"

fi



alias ls="ls $LS_OPTIONS"

 

dircolors -c on my computer gives:

[omar@omarserenity omar]$ dircolors -c

setenv LS_COLORS 'no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=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:*.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:'

Link to comment
Share on other sites

My ~/.kde/share/config/konsolerc looks like this:

[Desktop Entry]

MenuBar=Enabled

defaultfont=fixed,12,5,15,50,0

has frame=true

schema=/usr/share/apps/konsole/Linux.schema

scrollbar=2

 

/usr/share/apps/konsole/Linux.schema looks like this:

# linux color schema for konsole



title Linux Colors



# FIXME

#

# The flaw in this schema is that "blick" comes out on the

# Linux console as intensive background, really.

# Since this is not used in clients you'll hardly notice

# it in practice.



# foreground colors



# note that the default background color is flagged

# to become transparent when an image is present.



#   slot    transparent bold

#      | red grn blu  | |

#      V V--color--V  V V



color  0 178 178 178  0 0  # regular   foreground color (White)

color  1   0   0   0  1 0  # regular   background color (Black)



color  2   0   0   0  0 0  # regular   color 0 Black

color  3 178  24  24  0 0  # regular   color 1 Red

color  4  24 178  24  0 0  # regular   color 2 Green

color  5 178 104  24  0 0  # regular   color 3 Yellow

color  6  24  24 178  0 0  # regular   color 4 Blue

color  7 178  24 178  0 0  # regular   color 5 Magenta

color  8  24 178 178  0 0  # regular   color 6 Cyan

color  9 178 178 178  0 0  # regular   color 7 White



# intensive colors



# instead of changing the colors, we've flaged the text to become bold



color 10 255 255 255  0 0  # intensive foreground color

color 11 104 104 104  1 0  # intensive background color



color 12 104 104 104  0 0  # intensive color 0

color 13 255  84  84  0 0  # intensive color 1

color 14  84 255  84  0 0  # intensive color 2

color 15 255 255  84  0 0  # intensive color 3

color 16  84  84 255  0 0  # intensive color 4

color 17 255  84 255  0 0  # intensive color 5

color 18  84 255 255  0 0  # intensive color 6

color 19 255 255 255  0 0  # intensive color 7

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...