diff --git a/configuration/bash-prompt.sh b/configuration/bash-prompt.sh index 90affa8..0e958f5 100644 --- a/configuration/bash-prompt.sh +++ b/configuration/bash-prompt.sh @@ -1,4 +1,4 @@ -# Définition des couleurs du prompt +# Prompt colors if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then PS1_USER='\[$(tput setaf 27)\]' PS1_HOST='\[$(tput setaf 37)\]' @@ -18,10 +18,12 @@ fi BOLD='\[$(tput bold)\]' RESET='\[$(tput sgr0)\]' -# Définition du prompt +# Username or red color if root if [ $UID = 0 ]; then PS1_ID=$PS1_ROOT else PS1_ID=$PS1_USER'\u'$PS1_MISC@$PS1_HOST fi + +# Prompt definition PS1=$RESET$BOLD$PS1_ID'\h '$PS1_PATH'\w'$PS1_GIT'$(__git_ps1)'"\n"$PS1_MISC'\$ '$RESET