View previous topic :: View next topic |
Author |
Message |
T2 n00b
Joined: 01 Jun 2002 Posts: 67 Location: Slovenia
|
Posted: Tue Jun 11, 2002 9:44 am Post subject: gdm doesn't export SHELL temp. fix + beautified ls |
|
|
hi
I noticed that when loging in from gdm, SHELL variable is empty, so /etc/profile script doesn't set that fancy colored PS1
here's something I added at the end of /etc/profile to fix this and make ls more human friendly.
You can modify /etc/DIR_COLORS to ie.
...
DIR 01;32
...
for increased visibility on transparent aterm or black background xterms
Code: |
############################################
#sets LS_COLORS
eval `dircolors -b /etc/DIR_COLORS`
#sets LS_OPTIONS
# Extra command line options for ls go here.
# Basically these ones are:
# -F = show '/' for dirs, '*' for executables, etc.
# -T 0 = don't trust tab spacing when formatting ls output.
# -b = better support for special characters
export LS_OPTIONS="-F -b -T 0 --color"
#alias for nice output
alias ls='/bin/ls $LS_OPTIONS'
alias ll='/bin/ls $LS_OPTIONS -l -h'
alias df='df -h'
#ommited SHELL variable testing, assuming bash as default shell
if [ `/usr/bin/whoami` = 'root' ]
then
export PS1='\[\033[01;31m\]\h \[\033[01;31m\]\W \$ \[\033[00m\]'
else
export PS1='\[\033[01;38m\]\u@\h \[\033[01;38m\]\W \$ \[\033[00m\]'
fi
|
|
|
Back to top |
|
|
mcking n00b
Joined: 04 Aug 2002 Posts: 25 Location: Baghdad, Iraq
|
Posted: Sun Aug 04, 2002 3:14 am Post subject: this is ok, but it is not the Right Way |
|
|
/etc/profile really isn't the right place to set your prompt. It is for setting global variables for all users and is sourced when you login.
the bashrc/zshrc/cshrc files are sourced for interactive shells.
If you want all users to have the same prompt, you can put your prompt stuff in /etc/bashrc and if a particular user wants to override it, they can put their own stuff in ~user/.bashrc |
|
Back to top |
|
|
Dolio l33t
Joined: 17 Jun 2002 Posts: 650
|
Posted: Sun Aug 04, 2002 3:34 am Post subject: Hmm |
|
|
The default Gentoo install has /etc/profile set a basic shell prompt, and if memory serves, the ones in that listing are the default values.
Also, I just put a prompt in /etc/bashrc and it didn't seem to do anything. Only .bashrc works. _________________ They don't have a good bathroom to do coke in. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|