summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReiner Herrmann <reiner@reiner-h.de>2015-10-23 20:35:51 +0200
committerReiner Herrmann <reiner@reiner-h.de>2015-10-23 20:40:19 +0200
commit7f5acda1a4f5009b80e4101e1ed7ee783ed38a22 (patch)
treeec04f89e8e455fc62f72aacec523445eba1de865
parent0e595d8005f790383cbf12c1063bb6d941b23e65 (diff)
bashrc: increase readability, use red for root
-rw-r--r--bashrc9
1 files changed, 8 insertions, 1 deletions
diff --git a/bashrc b/bashrc
index 2b20df2..8a6b5fc 100644
--- a/bashrc
+++ b/bashrc
@@ -42,7 +42,14 @@ case "$TERM" in
;;
esac
-PS1=${TITLE}'(\[\033[1;33m\]\u\[\033[0m\]@\[\033[0;32m\]\h\[\033[0m\]) \W$(__git_ps1) \[\033[0;31m\]\\$\[\033[0m\] > '
+# prompt
+reset='\[\033[0m\]'
+yellow_b='\[\033[1;33m\]'
+green='\[\033[0;32m\]'
+red='\[\033[0;31m\]'
+red_b='\[\033[1;31m\]'
+[ $(id -u) -eq 0 ] && user_color=$red_b || user_color=$yellow_b
+PS1=${TITLE}"($user_color\u$reset@$green\h$reset) \W\$(__git_ps1) $red\$$reset > "
export PATH=~/Apps/bin:$PATH
export EDITOR="/usr/bin/vim"