diff options
author | Patrick Spek <p.spek@tyil.nl> | 2020-02-21 09:13:47 +0100 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2020-02-21 09:13:47 +0100 |
commit | 002f99da805420cb93d3f466da343d60a84ceb66 (patch) | |
tree | f0c33673c284ef88a4a99eddbe0cbfef21a838c2 /.bashrc | |
parent | a83d7d75de7363ebc4c3ec4ff4c4558ab64016d2 (diff) |
Update username color when root
Diffstat (limited to '.bashrc')
-rw-r--r-- | .bashrc | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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" |