Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gdm doesn't export SHELL temp. fix + beautified ls
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
T2
n00b
n00b


Joined: 01 Jun 2002
Posts: 67
Location: Slovenia

PostPosted: Tue Jun 11, 2002 9:44 am    Post subject: gdm doesn't export SHELL temp. fix + beautified ls Reply with quote

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
View user's profile Send private message
mcking
n00b
n00b


Joined: 04 Aug 2002
Posts: 25
Location: Baghdad, Iraq

PostPosted: Sun Aug 04, 2002 3:14 am    Post subject: this is ok, but it is not the Right Way Reply with quote

/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
View user's profile Send private message
Dolio
l33t
l33t


Joined: 17 Jun 2002
Posts: 650

PostPosted: Sun Aug 04, 2002 3:34 am    Post subject: Hmm Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
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