Make bash prompt more colorful

As a side effect, bashrc is now also shellcheck clean :)
This commit is contained in:
Daniel - 2020-07-25 15:42:16 +02:00
parent daa67974bf
commit 645959cdf6
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
1 changed files with 7 additions and 3 deletions

10
bashrc Normal file → Executable file
View File

@ -38,13 +38,17 @@ shopt -s checkwinsize
if [[ "$TERM" = "dumb" ]]; then
PS1="\u@\h:\w$ "
else
PURPLE="\e[0;35m"
YELLOW="\e[0;32m"
RED="\e[0;31m"
NOCOLOR="\e[m"
if [[ -f ~/.config/bash/git-prompt.sh ]]; then
GIT_PROMPT='$(__git_ps1 "(%s)")'
GIT_PROMPT="\$(__git_ps1 \"${PURPLE}(${NOCOLOR}%s${PURPLE})${NOCOLOR}\")"
else
GIT_PROMPT=''
fi
PS1="[\[\e[0;32m\u@\h\e[m\] [\[\e[0;31m\w\e[m\]] [\t] $GIT_PROMPT\n└── "
unset GIT_PROMPT
PS1="\[${PURPLE}[${YELLOW}\u@\h${PURPLE}] [${RED}\w${PURPLE}] [${NOCOLOR}\t${PURPLE}] ${GIT_PROMPT}\]\n└── "
unset GIT_PROMPT PURPLE YELLOW RED NOCOLOR
fi
# Enable color support of ls and also add handy aliases