Skip to content

Instantly share code, notes, and snippets.

@TyOverby
Last active February 28, 2016 04:56
Show Gist options
  • Select an option

  • Save TyOverby/03feebe8c75b999250cd to your computer and use it in GitHub Desktop.

Select an option

Save TyOverby/03feebe8c75b999250cd to your computer and use it in GitHub Desktop.
export PATH="$PATH:$HOME/.cargo/bin"
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/lib"
set_fg()
{
printf "\001\e[38;5;${1}m\002"
}
set_bg()
{
printf "\001\e[48;5;${1}m\002"
}
reset()
{
printf "\e[0m"
}
prompt()
{
# Current directory
set_fg 38
set_bg 237
printf "${PWD/#$HOME/\~}"
# Git branch
set_fg 37
declare -f __git_ps1 > /dev/null && __git_ps1
# Separator
set_bg 235
printf " "
# Whitespace
reset
echo -en " "
}
PS1='$(prompt)'
mytitle=""
echo -e '\001\033]2;'$mytitle'\007\002'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment