Skip to content

Instantly share code, notes, and snippets.

@hansek
Last active February 13, 2017 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hansek/0621b2a8bcbecd52beb479ac37255372 to your computer and use it in GitHub Desktop.
Save hansek/0621b2a8bcbecd52beb479ac37255372 to your computer and use it in GitHub Desktop.
# Bash-it theme based on Solarized colors
# https://gist.github.com/hansek
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM=gnome-256color
elif [[ $TERM != dumb ]] && infocmp xterm-256color >/dev/null 2>&1; then
export TERM=xterm-256color
fi
# Solarized
YELLOW=$(tput setaf 136)
ORANGE=$(tput setaf 166)
RED=$(tput setaf 160)
MAGENTA=$(tput setaf 162)
VIOLET=$(tput setaf 62)
BLUE=$(tput setaf 32)
CYAN=$(tput setaf 36)
GREEN=$(tput setaf 100)
BOLD=$(tput bold)
RESET=$(tput sgr0)
COLOR_TIME=$RESET
COLOR_ENV=$RED
COLOR_USER=$YELLOW
COLOR_HOST=$BLUE
COLOR_PATH=$GREEN
COLOR_GIT=$VIOLET
VIRTUALENV_THEME_PROMPT_PREFIX="(\[$COLOR_ENV\]"
VIRTUALENV_THEME_PROMPT_SUFFIX="\[$COLOR_DEFAULT\]) "
function prompt_command() {
PS1="\t $(virtualenv_prompt)\[$COLOR_USER\]\u\[$RESET\] at \[$COLOR_HOST\]\h\[$RESET\] in \[$COLOR_PATH\]\w\[$RESET\]\[$COLOR_GIT\]\$(__git_ps1) \[$RESET\]» "
}
safe_append_prompt_command prompt_command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment