dotfiles/dot_bashrc.d/shell-prompt.sh

19 lines
632 B
Bash

if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[01;31m\][\h\[\033[01;36m\] \W\[\033[01;31m\]]\$\[\033[00m\] '
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