dotfiles/dot_config/bash/shell-prompt.sh

21 lines
707 B
Bash
Raw Normal View History

2021-04-13 14:43:04 -04:00
if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[01;31m\][\h\[\033[01;36m\] \W\[\033[01;31m\]]\$\[\033[00m\] '
2022-05-10 13:58:50 -04:00
elif which starship > /dev/null 2>&1 ; then
eval "$(starship init bash)"
2021-04-13 14:43:04 -04:00
else
if type __git_ps1 > /dev/null 2>&1 ; then
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWSTASHSTATE=1
GIT_PS1_SHOWUNTRACKEDFILES=1
GIT_PS1_SHOWUPSTREAM="auto"
GIT_PS1_SHOWCOLORHINTS=1
GIT_PS1_HIDE_IF_PWD_IGNORED=1
if [[ -n $SSH_CLIENT ]] ; then
SSH_CHAR="📡"
fi
PROMPT_COMMAND='history -a; __git_ps1 "\[\033[01;32m\][\u@\h\[\033[01;34m\] ${SSH_CHAR}\w\[\033[01;32m\]]\[\033[00m\]" "\\\$ "'
else
PS1='\[\033[01;32m\][\u@\h\[\033[01;34m\] \w\[\033[01;32m\]]\[\033[00m\]\$ '
fi
fi