[ -r /usr/lib/git-core/git-sh-prompt ] && . /usr/lib/git-core/git-sh-prompt # define a fallback for __git_ps1 if git is not installed if [ "x$(type -t __git_ps1)" != "xfunction" ]; then __git_ps1() { echo "" } fi GIT_PS1_SHOWDIRTYSTATE=1 GIT_PS1_SHOWSTASHSTATE=1 GIT_PS1_SHOWUPSTREAM="auto" __prompt_func() { ################################################ # THERE SHOULD BE NO NEED TO EDIT THIS SECTION # ################################################ #$normal will reset the colour to the default, use it to stop using a certain colour (see "prompt parts") local normal="\[\e[0m\]" # # # # # # # #BACKGROUNDS # # # # # # # local blackbg=";40m\]" local redbg=";41m\]" local greenbg=";42m\]" local brownbg=";43m\]" local bluebg=";44m\]" local purplebg=";45m\]" local cyanbg=";46m\]" local greybg=";47m\]" ############################################################################################ # THERE SHOULD BE NO NEED TO EDIT THIS SECTION (UNLESS YOU DO NOT WANT A BLACK BACKGROUND) # ############################################################################################ # # # # # # # #FOREGROUNDS # # # # # # # local black="\[\e[0;30$blackbg" local redfaint="\[\e[0;31$blackbg" local greenfaint="\[\e[0;32$blackbg" local brownfaint="\[\e[0;33$blackbg" local bluefaint="\[\e[0;34$blackbg" local purplefaint="\[\e[0;35$blackbg" local cyanfaint="\[\e[0;36$blackbg" local greyfaint="\[\e[0;37$blackbg" local grey="\[\e[1;30$blackbg" local red="\[\e[1;31$blackbg" local green="\[\e[1;32$blackbg" local yellow="\[\e[1;33$blackbg" local blue="\[\e[1;34$blackbg" local pink="\[\e[1;35$blackbg" local cyan="\[\e[1;36$blackbg" local white="\[\e[1;37$blackbg" ################################## # EDIT THIS STUFF TO YOUR LIKING # ################################## # # # # # # # #PROMPT PARTS # # # # # # # local prompt_opening_brace="$cyan[$normal" local prompt_closing_brace="$cyan]$normal" local prompt_date="\d" local prompt_hostname_short="$blue\h$normal" local prompt_hostname_long="\H" local prompt_jobs="\j" local prompt_terminal="\l" local prompt_shellname="\s" local prompt_time_24="\t" local prompt_time_12="\T" local prompt_time_12_am_pm="\@" local prompt_username="$greenfaint\u$normal" local prompt_version="\v" local prompt_version_patchlevel="\V" local prompt_pwd_long="$cyanfaint\w$normal" local prompt_pwd_short="$red\W$normal" local prompt_history_number="\!" local prompt_session_number="\#" local prompt_usertype_sign="\\$" local prompt_git_branch="$white\$(__git_ps1)$normal" local dotfiles_dirty="$red\$([ -f ~/.local/var/dotfiles/dirty ] && echo -n \\\!\ )$normal" # # # # # # # # #FINAL PROMPT # # # # # # # # echo -n "$prompt_opening_brace $dotfiles_dirty$prompt_username@$prompt_hostname_short $prompt_pwd_long$prompt_git_branch$prompt_closing_brace$prompt_usertype_sign " }