Skip to content

Instantly share code, notes, and snippets.

@yrro
Created February 28, 2014 18:37
Show Gist options
  • Save yrro/9276937 to your computer and use it in GitHub Desktop.
Save yrro/9276937 to your computer and use it in GitHub Desktop.
case $(locale charmap) in
UTF-8)
_smile_happy='☺'
_smile_frown='☹'
;;
*)
_smile_happy=':)'
_smile_frown=':('
;;
esac
function smile {
if [[ $? -eq 0 ]]; then
printf "${_csi_green}${_smile_happy}"
else
printf "${_csi_red}${_smile_frown}"
fi
}
function user_colour {
if test "$UID" = 0; then
printf "${_csi_red}"
else
printf "${_csi_green}"
fi
}
_csi_default=$(tput sgr 0)
_csi_cyan=$(tput setaf 6)
_csi_green=$(tput setaf 2)
_csi_red=$(tput setaf 1)
_csi_gold=$(tput setaf 3)
GIT_PS1_SHOWDIRTYSTATE=1
GIT_PS1_SHOWSTASHSTATE=1
#GIT_PS1_SHOWUNTRACKEDFILES=1
GIT_PS1_SHOWUPSTREAM=verbose
PS1="\n\$(smile) ${_csi_cyan}\\A $(user_colour)\\u@\\h ${_csi_gold}\\w${_csi_default} \$(__git_ps1 '(%s)')\n\\$ "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment