txtwht="\[\e[00m\]" # White txtred="\[\e[0;31m\]" # Red txtgrn="\[\e[0;32m\]" # Green txtpur="\[\e[0;35m\]" # Purple txtblu="\[\e[0;34m\]" # Blue bldgrn="\[\e[1;32m\]" # Green bldcyn="\[\e[1;36m\]" # Cyan function parse_git_this_branch { git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/' } function parse_git_deleted { [[ $(git status 2> /dev/null | grep deleted:) != "" ]] && echo "-" } function parse_git_added { [[ $(git status 2> /dev/null | grep "Untracked files:") != "" ]] && echo "+" } function parse_git_modified { [[ $(git status 2> /dev/null | grep modified:) != "" ]] && echo "*" } function parse_git_dirty { echo "$(parse_git_added)$(parse_git_modified)$(parse_git_deleted)" } function parse_git_branch { git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/(\1$(parse_git_dirty))/" } function parse_ps1 { echo "${bldcyn}[\W]${txtwht}\$(parse_git_branch)\n$> " } if [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' else PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' fi unset color_prompt force_color_prompt export PS1=$(parse_ps1) source "$HOME/bin/ps1_functions" ps1_set --prompt ∴