Click to See Complete Forum and Search --> : coloured file listing in xterm / aterm under fluxbox


jme
02-03-2004, 06:57 AM
When Im within FluxBox running under Slackware 9.1 and I am using Xterm or Aterm under root the file litings are colored depending on what typr of file or directory it is.

However, when I am using it as a normal user this effect disspears. The effect is fine when I am using the concoles (outside of X and FluxBox) - it is only when I am a normal user and using aterm or xterm that I cannot get the effect to work.

Any advice and soultions would be greatly appreciated.

Thanks,
Jme

mrBen
02-03-2004, 07:25 AM
Check if ls --color works. If so, then you need to add an alias - something like alias ls 'ls --color' should do the trick.

You'll need to add it to your (I think) ~/.bashrc to make the change permanent across all sessions.

jme
02-03-2004, 07:59 AM
Thanks mrBen the --color tag did get it to work but I don't have a ~.bashrc file to edit.


One other thing as well....when Im root the prompt reads

root@penguinbox#

whereas when Im the normal user I just get

bash-2.0b$

Is there anyway to get the terminal to display

username@penguinbox$ instead so that I will know what id I am logged in under.

BTW: again there is no problem with this when using the tty consoles just the virtual consoles within X.

Thanks for all of your help.

Jme

mrBen
02-03-2004, 09:17 AM
OK - here's the .bashrc I have at the moment (not created by me, but seems to be good):


# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If running interactively, then:
if [ "$PS1" ]; then

# don't put duplicate lines in the history. See bash(1) for more options
# export HISTCONTROL=ignoredups

# enable color support of ls and also add handy aliases
eval `dircolors -b`
alias ls='ls --color=auto'
#alias dir='ls --color=auto --format=vertical'
#alias vdir='ls --color=auto --format=long'

# some more ls aliases
#alias ll='ls -l'
#alias la='ls -A'
#alias l='ls -CF'

# set a fancy prompt
PS1='\[\033[1;32m\]\u@\h\[\033[0m\]:\w\$ '
# If this is an xterm set the title to user@host:dir
case $TERM in
dtterm|xterm*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
;;
*)
;;
esac

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc).
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi


Just cut 'n' paste that into a file, save as .bashrc in your home directory, and that should be you.

jme
02-03-2004, 03:39 PM
Thanks for all of your help mrBen.

Just needed to comment out the eval `dircolors -b` line otherwise I get a series olf errors within the terminal before the prompt.

All the best,
Jme

sclebo05
04-20-2004, 06:00 PM
by simply adding:

alias ls 'ls --color=auto'

to my /etc/profile, i was able to set color for all my users. thanks for the post.

Artimus
04-20-2004, 06:26 PM
I believe the promt thing can be fixed by running aterm with the --loginShell option

a.k.a

aterm --loginShell