aboutsummaryrefslogtreecommitdiff
path: root/.bashrc
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2020-02-21 09:13:47 +0100
committerPatrick Spek <p.spek@tyil.nl>2020-02-21 09:13:47 +0100
commit002f99da805420cb93d3f466da343d60a84ceb66 (patch)
treef0c33673c284ef88a4a99eddbe0cbfef21a838c2 /.bashrc
parenta83d7d75de7363ebc4c3ec4ff4c4558ab64016d2 (diff)
Update username color when root
Diffstat (limited to '.bashrc')
-rw-r--r--.bashrc11
1 files changed, 10 insertions, 1 deletions
diff --git a/.bashrc b/.bashrc
index eea2543..55d8d66 100644
--- a/.bashrc
+++ b/.bashrc
@@ -54,8 +54,17 @@ __precmd()
# wrapping issues later in life. It is also *very* important to wrap
# things in double quotes for the PS1 coloring to be applied correctly!
+ PS1=
+
# Set the username, hostname and path
- PS1="\001$SHELLC_F_GREEN\002\u\001$SHELLC_RESET_COLOR_F\002"
+ if [[ 0 < $EUID ]]
+ then
+ PS1+="\001$SHELLC_F_GREEN\002"
+ else
+ PS1+="\001$SHELLC_F_RED\002"
+ fi
+
+ PS1+="\u\001$SHELLC_RESET_COLOR_F\002"
PS1+="\001$SHELLC_F_LIGHTGRAY\002@\001$SHELLC_RESET_COLOR_F\002"
PS1+="\001$SHELLC_F_MAGENTA\002\H\001$SHELLC_RESET_COLOR_F\002"
PS1+="\001$SHELLC_F_LIGHTGRAY\002:\001$SHELLC_RESET_COLOR_F\002"