]> arthur.barton.de Git - ConfigScripts.git/blobdiff - sys/bashrc
Don't set $USER and $UID
[ConfigScripts.git] / sys / bashrc
index 2e81d0a49ea27ac3e1237c444eb495bd6f2765d6..ce98922e21e8686a42e46e586a65fbbf6c9dc1ba 100644 (file)
@@ -1,6 +1,6 @@
 #
 # /etc/bash.bashrc: System-wide rc file for interactive bash(1) shells.
-# Written 2003-2013 by Alexander Barton (alex@barton.de)
+# Written 2003-2014 by Alexander Barton (alex@barton.de)
 #
 
 [ -e ~/.ConfigScripts.debug ] && echo " >> /etc/bash.bashrc ..."
@@ -108,14 +108,14 @@ PS1_Path() {
 }
 
 PS1="${COLOR_PREPOSTTXT}${PS1_BEGIN:-<}"
-[ "$UID" -eq 0 ] \
+[ "$LOGNAME" = "root" ] \
        || PS1="${PS1}${COLOR_USER}\u${COLOR_AT}@"
 PS1="${PS1}${COLOR_HOST}\h"
 PS1="${PS1}${COLOR_COLON}:"
 PS1="${PS1}${COLOR_PATH}\$(PS1_Path) "
 PS1="${PS1}${COLOR_HISTORY}\!"
 PS1="${PS1}${COLOR_PREPOSTTXT}${PS1_END:->}${COLOR_RESET} "
-[ "$UID" -eq 0 ] \
+[ "$LOGNAME" = "root" ] \
        && PS1="${PS1}${COLOR_PROMPT_ROOT}\\\$${COLOR_RESET} " \
        || PS1="${PS1}${COLOR_PROMPT_USER}\\\$${COLOR_RESET} "
 [ "$(type -t __git_ps1)" ] \
@@ -175,7 +175,7 @@ fi
 # If this is an xterm set the title to user@host:dir
 case $TERM in
 xterm*|rxvt|screen)
-       PROMPT_COMMAND='printf "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
+       PROMPT_COMMAND='printf "\033]0;${LOGNAME}@${HOSTNAME}: ${PWD}\007"'
        ;;
 *)
        ;;