.
This commit is contained in:
parent
b071bedf6d
commit
4c7cdca4fa
@ -14,6 +14,7 @@ function bash_ps1 () {
|
|||||||
local PS1_COLOR_USERNAME="${PS1_COLOR_USERNAME:-\[\e[34;1m\]}"
|
local PS1_COLOR_USERNAME="${PS1_COLOR_USERNAME:-\[\e[34;1m\]}"
|
||||||
local PS1_COLOR_USERHOSTAT="${PS1_COLOR_USERHOSTAT:-\[\e[34;1m\]}"
|
local PS1_COLOR_USERHOSTAT="${PS1_COLOR_USERHOSTAT:-\[\e[34;1m\]}"
|
||||||
local PS1_COLOR_HOSTNAME="${COLOR_HOSTNAME:-\[\e[34;1m\]}"
|
local PS1_COLOR_HOSTNAME="${COLOR_HOSTNAME:-\[\e[34;1m\]}"
|
||||||
|
local PS1_COLOR_GITBRANCH="${PS1_COLOR_GITBRANCH:-\[\e[33;1m\]}"
|
||||||
local PS1_COLOR_VENV="${PS1_COLOR_VENV:-\[\033[0;36m\]}"
|
local PS1_COLOR_VENV="${PS1_COLOR_VENV:-\[\033[0;36m\]}"
|
||||||
local PS1_COLOR_PATH="${PS1_COLOR_PATH:-\[\033[0;37m\]}"
|
local PS1_COLOR_PATH="${PS1_COLOR_PATH:-\[\033[0;37m\]}"
|
||||||
local PS1_COLOR_EXIT_STATUS="${PS1_COLOR_EXIT_STATUS:-\[\033[1;37m\]\[\033[41m\]}"
|
local PS1_COLOR_EXIT_STATUS="${PS1_COLOR_EXIT_STATUS:-\[\033[1;37m\]\[\033[41m\]}"
|
||||||
@ -23,13 +24,12 @@ function bash_ps1 () {
|
|||||||
|
|
||||||
local CURRENT_CONTEXT=""
|
local CURRENT_CONTEXT=""
|
||||||
|
|
||||||
export GIT_PS1_SHOWCOLORHINTS=1
|
|
||||||
export GIT_PS1_SHOWDIRTYSTATE=1
|
export GIT_PS1_SHOWDIRTYSTATE=1
|
||||||
export GIT_PS1_SHOWUNTRACKEDFILES=1
|
export GIT_PS1_SHOWUNTRACKEDFILES=1
|
||||||
|
|
||||||
[[ $LAST_EXIT_STATUS != 0 ]] && EXIT_STATUS="${PS1_COLOR_DIVIDER}[${PS1_COLOR_EXIT_STATUS}${LAST_EXIT_STATUS}${PS1_COLOR_DIVIDER}]"
|
[[ $LAST_EXIT_STATUS != 0 ]] && EXIT_STATUS="${PS1_COLOR_DIVIDER}[${PS1_COLOR_EXIT_STATUS}${LAST_EXIT_STATUS}${PS1_COLOR_DIVIDER}]"
|
||||||
[[ $(type -t __git_ps1) == function ]] && GIT_BRANCH="${PS1_COLOR_OFF}$(__git_ps1)"
|
[[ $(type -t __git_ps1) == function ]] && GIT_BRANCH="${PS1_COLOR_DIVIDER}─[${PS1_COLOR_GITBRANCH}$(__git_ps1 '%s')${PS1_COLOR_DIVIDER}]"
|
||||||
[[ -n "$VIRTUAL_ENV" ]] && PYTHON_ENV="${PS1_COLOR_DIVIDER}(${PS1_COLOR_VENV}${VIRTUAL_ENV##*/}${PS1_COLOR_DIVIDER})"
|
[[ -n "$VIRTUAL_ENV" ]] && PYTHON_ENV="${PS1_COLOR_DIVIDER}─[${PS1_COLOR_VENV}${VIRTUAL_ENV##*/}${PS1_COLOR_DIVIDER}]"
|
||||||
if [[ $(type kubectl) ]]; then
|
if [[ $(type kubectl) ]]; then
|
||||||
CURRENT_CONTEXT="$(kubectl config current-context)"
|
CURRENT_CONTEXT="$(kubectl config current-context)"
|
||||||
if [[ "$CURRENT_CONTEXT" != "default" ]];then
|
if [[ "$CURRENT_CONTEXT" != "default" ]];then
|
||||||
@ -41,7 +41,7 @@ function bash_ps1 () {
|
|||||||
if [[ $(status_dotfiles check_error) == YES ]];then
|
if [[ $(status_dotfiles check_error) == YES ]];then
|
||||||
DOTF="${PS1_COLOR_DOTF}E"
|
DOTF="${PS1_COLOR_DOTF}E"
|
||||||
elif [[ $(status_dotfiles check_status) ]];then
|
elif [[ $(status_dotfiles check_status) ]];then
|
||||||
DOTF="${PS1_COLOR_DOTF}."
|
DOTF="${PS1_COLOR_DOTF}+"
|
||||||
elif [[ $(status_dotfiles check_push) ]];then
|
elif [[ $(status_dotfiles check_push) ]];then
|
||||||
DOTF="${PS1_COLOR_DOTF}p"
|
DOTF="${PS1_COLOR_DOTF}p"
|
||||||
fi
|
fi
|
||||||
@ -52,7 +52,7 @@ function bash_ps1 () {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n $DOTF ]] || [[ -n $TODO ]];then
|
if [[ -n $DOTF ]] || [[ -n $TODO ]];then
|
||||||
STATUS="${PS1_COLOR_DIVIDER}[${DOTF}${TODO}${PS1_COLOR_DIVIDER}]"
|
STATUS="${PS1_COLOR_DIVIDER}─[${DOTF}${TODO}${PS1_COLOR_DIVIDER}]"
|
||||||
fi
|
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}"
|
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}"
|
||||||
|
Loading…
Reference in New Issue
Block a user