# Git information in prompt . /run/current-system/sw/share/bash-completion/completions/git-prompt.sh # Prompt colors 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)\]' # 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