From 002f99da805420cb93d3f466da343d60a84ceb66 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Fri, 21 Feb 2020 09:13:47 +0100 Subject: Update username color when root --- .bashrc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to '.bashrc') 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" -- cgit v1.1