Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: venv Support #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 38 additions & 29 deletions theme.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,38 @@
# More info about color codes in https://en.wikipedia.org/wiki/ANSI_escape_code


PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:=""}
POWERLINE_LEFT_SEPARATOR=" "
POWERLINE_PROMPT="last_status user_info cwd scm"

USER_INFO_SSH_CHAR=" "
USER_INFO_PROMPT_COLOR="C B"

SCM_GIT_CHAR=" "
SCM_PROMPT_CLEAN=""
SCM_PROMPT_DIRTY="*"
SCM_PROMPT_AHEAD="↑"
SCM_PROMPT_BEHIND="↓"
SCM_PROMPT_CLEAN_COLOR="G Bl"
SCM_PROMPT_DIRTY_COLOR="R Bl"
SCM_PROMPT_AHEAD_COLOR=""
SCM_PROMPT_BEHIND_COLOR=""
SCM_PROMPT_STAGED_COLOR="Y Bl"
SCM_PROMPT_UNSTAGED_COLOR="R Bl"
SCM_PROMPT_COLOR=${SCM_PROMPT_CLEAN_COLOR}

CWD_PROMPT_COLOR="B C"

STATUS_PROMPT_COLOR="Bl R B"
STATUS_PROMPT_ERROR="✘"
STATUS_PROMPT_ERROR_COLOR="Bl R B"
STATUS_PROMPT_ROOT="⚡"
STATUS_PROMPT_ROOT_COLOR="Bl Y B"
STATUS_PROMPT_JOBS="●"
STATUS_PROMPT_JOBS_COLOR="Bl Y B"
readonly PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:=""}
readonly POWERLINE_LEFT_SEPARATOR=" "
readonly POWERLINE_PROMPT="last_status venv user_info cwd scm"

readonly USER_INFO_SSH_CHAR=" "
readonly USER_INFO_PROMPT_COLOR="C B"

readonly VENV_PROMPT_COLOR="M Y"
readonly PYTHON_SYMBOL=''

readonly SCM_GIT_CHAR=" "
readonly SCM_PROMPT_CLEAN=""
readonly SCM_PROMPT_DIRTY="*"
readonly SCM_PROMPT_AHEAD="↑"
readonly SCM_PROMPT_BEHIND="↓"
readonly SCM_PROMPT_CLEAN_COLOR="G Bl"
readonly SCM_PROMPT_DIRTY_COLOR="R Bl"
readonly SCM_PROMPT_AHEAD_COLOR=""
readonly SCM_PROMPT_BEHIND_COLOR=""
readonly SCM_PROMPT_STAGED_COLOR="Y Bl"
readonly SCM_PROMPT_UNSTAGED_COLOR="R Bl"
readonly SCM_PROMPT_COLOR=${SCM_PROMPT_CLEAN_COLOR}

readonly CWD_PROMPT_COLOR="B C"

readonly STATUS_PROMPT_COLOR="Bl R B"
readonly STATUS_PROMPT_ERROR="✘"
readonly STATUS_PROMPT_ERROR_COLOR="Bl R B"
readonly STATUS_PROMPT_ROOT="⚡"
readonly STATUS_PROMPT_ROOT_COLOR="Bl Y B"
readonly STATUS_PROMPT_JOBS="●"
readonly STATUS_PROMPT_JOBS_COLOR="Bl Y B"

function __color {
local bg
Expand Down Expand Up @@ -90,6 +93,12 @@ function __powerline_cwd_prompt {
echo "\w|${CWD_PROMPT_COLOR}"
}

function __powerline_venv_prompt {
if [ -n "${VIRTUAL_ENV}" ] ; then
echo "$PYTHON_SYMBOL($(basename $VIRTUAL_ENV))|${VENV_PROMPT_COLOR}"
fi
}

function __powerline_scm_prompt {
git_local_branch=""
git_branch=""
Expand Down