diff --git a/.functions/ps1.sh b/.functions/ps1.sh index b4748ae..a243e7e 100644 --- a/.functions/ps1.sh +++ b/.functions/ps1.sh @@ -20,6 +20,7 @@ function bash_ps1 () { local K8S_CURRENT_CONTEXT="" local DOTF="" local TODO="" + local PASS="" local STATUS="" local PS1_COLOR_OFF='\[\033[0m\]' @@ -34,6 +35,7 @@ function bash_ps1 () { local PS1_COLOR_KUBERNETES="${PS1_COLOR_KUBERNETES:-\[\033[1;37m\]\[\033[44m\]}" local PS1_COLOR_TODO="${PS1_COLOR_TODO:-\[\033[1;30m\]\[\033[43m\]}" local PS1_COLOR_DOTF="${PS1_COLOR_DOTF:-\[\033[1;37m\]\[\033[45m\]}" + local PS1_COLOR_PASS="${PS1_COLOR_PASS:-\[\033[0;30m\]\[\033[47m\]}" local CURRENT_CONTEXT="" @@ -65,12 +67,21 @@ function bash_ps1 () { fi fi + if type -t pass > /dev/null; then + if [[ -n "$(pass git status --short 2> /dev/null)" ]];then + PASS="${PS1_COLOR_PASS}%" + elif [[ -n "$(pass git cherry -v)" ]];then + PASS="${PS1_COLOR_PASS}p" + fi + fi + + if [[ $(type -t todo_status) == function ]] && [[ "$(todo_status)" == "YES" ]];then TODO="${PS1_COLOR_TODO}T" fi if [[ -n $DOTF ]] || [[ -n $TODO ]];then - STATUS="${PS1_COLOR_DIVIDER}─[${DOTF}${TODO}${PS1_COLOR_DIVIDER}]" + STATUS="${PS1_COLOR_DIVIDER}─[${DOTF}${TODO}${PASS}${PS1_COLOR_DIVIDER}]" fi PS1="\n${PS1_COLOR_DIVIDER}┌──(${PS1_COLOR_USERNAME}\u${PS1_COLOR_USERHOSTAT}@${PS1_COLOR_HOSTNAME}\h${PS1_COLOR_DIVIDER})─[${PS1_COLOR_PATH}\w${PS1_COLOR_DIVIDER}]${EXIT_STATUS}${STATUS}${PYTHON_ENV}${K8S_CURRENT_CONTEXT}${GIT_BRANCH}"