From: Travis Swicegood Date: Sat, 5 Apr 2014 14:14:55 +0000 (-0500) Subject: Update powerline to show conda environments X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=aeb08aea3fb2673a9ec004f29af7be012a963bb6;p=common%2Fbash_it.git Update powerline to show conda environments --- diff --git a/themes/powerline/powerline.theme.bash b/themes/powerline/powerline.theme.bash index 81598de..012f933 100644 --- a/themes/powerline/powerline.theme.bash +++ b/themes/powerline/powerline.theme.bash @@ -53,9 +53,16 @@ function powerline_shell_prompt { } function powerline_virtualenv_prompt { - if [[ -n "$VIRTUAL_ENV" ]]; then - virtualenv=$(basename "$VIRTUAL_ENV") - VIRTUALENV_PROMPT="$(set_rgb_color ${LAST_THEME_COLOR} ${VIRTUALENV_THEME_PROMPT_COLOR})${THEME_PROMPT_SEPARATOR}${normal}$(set_rgb_color - ${VIRTUALENV_THEME_PROMPT_COLOR}) ${VIRTUALENV_CHAR}$virtualenv ${normal}" + local environ="" + + if [[ -n "$CONDA_DEFAULT_ENV" ]]; then + environ="conda: $CONDA_DEFAULT_ENV" + elif [[ -n "$VIRTUAL_ENV" ]]; then + environ=$(basename "$VIRTUAL_ENV") + fi + + if [[ -n "$environ" ]]; then + VIRTUALENV_PROMPT="$(set_rgb_color ${LAST_THEME_COLOR} ${VIRTUALENV_THEME_PROMPT_COLOR})${THEME_PROMPT_SEPARATOR}${normal}$(set_rgb_color - ${VIRTUALENV_THEME_PROMPT_COLOR}) ${VIRTUALENV_CHAR}$environ ${normal}" LAST_THEME_COLOR=${VIRTUALENV_THEME_PROMPT_COLOR} else VIRTUALENV_PROMPT=""