commit
04289e0400
|
|
@ -1,6 +1,13 @@
|
||||||
# Sexy Bash Prompt, inspired by "Extravagant Zsh Prompt"
|
# Sexy Bash Prompt, inspired by "Extravagant Zsh Prompt"
|
||||||
# Screenshot: http://cloud.gf3.ca/M5rG
|
# Screenshot: http://cloud.gf3.ca/M5rG
|
||||||
# A big thanks to \amethyst on Freenode
|
# A big thanks to \amethyst on Freenode
|
||||||
|
#
|
||||||
|
# Configuration:
|
||||||
|
# * To visualize python environment (virtualenv and conda) add in your .bash_profile the following line:
|
||||||
|
# export SEXY_THEME_SHOW_PYTHON=true
|
||||||
|
|
||||||
|
# Default setting
|
||||||
|
SEXY_THEME_SHOW_PYTHON="${SEXY_THEME_SHOW_PYTHON:=false}"
|
||||||
|
|
||||||
if tput setaf 1 &> /dev/null; then
|
if tput setaf 1 &> /dev/null; then
|
||||||
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
|
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
|
||||||
|
|
@ -34,9 +41,16 @@ parse_git_dirty () {
|
||||||
parse_git_branch () {
|
parse_git_branch () {
|
||||||
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/"
|
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/"
|
||||||
}
|
}
|
||||||
|
env_prompt () {
|
||||||
|
echo -e "($(virtualenv_prompt)$(condaenv_prompt))"
|
||||||
|
}
|
||||||
|
|
||||||
function prompt_command() {
|
function prompt_command() {
|
||||||
PS1="\[${BOLD}${MAGENTA}\]\u \[$WHITE\]at \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on \")\[$PURPLE\]\$(parse_git_branch)\[$WHITE\]\n\$ \[$RESET\]"
|
PS1="\[${BOLD}${MAGENTA}\]\u \[$WHITE\]at \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on \")\[$PURPLE\]\$(parse_git_branch)\[$WHITE\]\n\$ \[$RESET\]"
|
||||||
|
|
||||||
|
if [ "$SEXY_THEME_SHOW_PYTHON" = true ] ; then
|
||||||
|
PS1="\[${BOLD}${WHITE}\]$(env_prompt) "$PS1
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
safe_append_prompt_command prompt_command
|
safe_append_prompt_command prompt_command
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue