32 lines
996 B
Bash
32 lines
996 B
Bash
## File: ~/.bashrc.d/prompt
|
|
## Description: Configuration for the Bash prompt
|
|
## vim: ft=sh :
|
|
|
|
get_date() {
|
|
date '+%d.%m.%Y'
|
|
}
|
|
|
|
if [ -f /usr/share/git/completion/git-prompt.sh ]; then
|
|
source /usr/share/git/completion/git-prompt.sh
|
|
elif [ -f /usr/share/git/git-prompt.sh ]; then
|
|
source /usr/share/git/git-prompt.sh
|
|
elif [ -f /usr/lib/git-core/git-sh-prompt ]; then
|
|
source /usr/lib/git-core/git-sh-prompt
|
|
elif [ -f /etc/bash_completion.d/git-prompt ]; then
|
|
source /etc/bash_completion.d/git-prompt
|
|
elif [ -f ${HOME}/.git-prompt ]; then
|
|
source ${HOME}/.git-prompt
|
|
fi
|
|
|
|
GIT_PS1_SHOWDIRTYSTATE="true"
|
|
GIT_PS1_SHOWUPSTREAM="auto"
|
|
GIT_PS1_STATESEPARATOR=": "
|
|
|
|
DATE_BG="$(tput setab 68)"
|
|
GREY_BG="$(tput setab 240)"
|
|
RESET="$(tput sgr0)"
|
|
FILEPATH_TC="$(tput setaf 81)"
|
|
WHITE_TC="$(tput setaf 255)"
|
|
GREEN_TC="$(tput setaf 2)"
|
|
PS1='${DATE_BG}${WHITE_TC}$(get_date) ${GREY_BG} \u • ${FILEPATH_TC}\033[1m\w ${RESET} ${GREEN_TC}\033[3m$(__git_ps1 "git:(%s)")${RESET}\n\$ '
|
|
PS2=" -> "
|