You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
779 B
Bash
28 lines
779 B
Bash
# Définition des couleurs du prompt
|
|
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
|
|
PS1_USER='\[$(tput setaf 27)\]'
|
|
PS1_HOST='\[$(tput setaf 37)\]'
|
|
PS1_ROOT='\[$(tput setaf 160)\]'
|
|
PS1_PATH='\[$(tput setaf 64)\]'
|
|
PS1_GIT='\[$(tput setaf 136)\]'
|
|
PS1_MISC='\[$(tput setaf 230)\]'
|
|
|
|
else
|
|
PS1_USER='\[$(tput setaf 4)\]'
|
|
PS1_HOST='\[$(tput setaf 6)\]'
|
|
PS1_ROOT='\[$(tput setaf 1)\]'
|
|
PS1_PATH='\[$(tput setaf 2)\]'
|
|
PS1_GIT='\[$(tput setaf 3)\]'
|
|
PS1_MISC='\[$(tput setaf 7)\]'
|
|
fi
|
|
BOLD='\[$(tput bold)\]'
|
|
RESET='\[$(tput sgr0)\]'
|
|
|
|
# Définition du prompt
|
|
if [ $UID = 0 ]; then
|
|
PS1_ID=$PS1_ROOT
|
|
else
|
|
PS1_ID=$PS1_USER'\u'$PS1_MISC@$PS1_HOST
|
|
fi
|
|
PS1=$RESET$BOLD$PS1_ID'\h '$PS1_PATH'\w'$PS1_GIT'$(__git_ps1)'"\n"$PS1_MISC'\$ '$RESET
|