Created
August 4, 2017 17:03
-
-
Save johnpbloch/306cb94ad8222cad30acf4e27b36808e to your computer and use it in GitHub Desktop.
My custom theme for bash_it based on powerline multiline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. "$BASH_IT/themes/powerline-multiline/powerline-multiline.base.bash" | |
function __powerline_docker_compose_prompt { | |
local prompt | |
if docker-compose config &>/dev/null | |
then | |
prompt+="${DOCKER_CHAR}" | |
else | |
return | |
fi | |
local status="$(docker-compose ps | tail -n +3)" | |
local count=$(echo "$status" | wc -l) | |
local color | |
if [[ "$(echo "$status" | grep ' Exit [0-9]')" ]] | |
then | |
color=${DOCKER_CRASH_COLOR} | |
local crash_count="$(echo "$status" | grep ' Exit [0-9]' | wc -l)" | |
prompt+=" ${DOCKER_DOWN_CHAR}${crash_count}" | |
if [[ "${count}" -gt ${crash_count} ]] | |
then | |
prompt+=" ${DOCKER_UP_CHAR}$(($count - $crash_count))" | |
fi | |
elif [[ "$(echo "$status" | grep ' Up ' | wc -l)" -eq "0" ]] | |
then | |
color=${DOCKER_DOWN_COLOR} | |
else | |
color=${DOCKER_COLOR} | |
prompt+=" ${DOCKER_UP_CHAR}${count}" | |
fi | |
echo "${prompt}|${color}" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
. "$BASH_IT/custom/themes/powerline-jpb/powerline-jpb.base.bash" | |
PROMPT_CHAR=${POWERLINE_PROMPT_CHAR:="❯"} | |
POWERLINE_LEFT_SEPARATOR=${POWERLINE_LEFT_SEPARATOR:=""} | |
POWERLINE_RIGHT_SEPARATOR=${POWERLINE_RIGHT_SEPARATOR:=""} | |
USER_INFO_SSH_CHAR=${POWERLINE_USER_INFO_SSH_CHAR:=" "} | |
USER_INFO_THEME_PROMPT_COLOR=32 | |
USER_INFO_THEME_PROMPT_COLOR_SUDO=202 | |
PYTHON_VENV_CHAR=${POWERLINE_PYTHON_VENV_CHAR:="❲p❳ "} | |
CONDA_PYTHON_VENV_CHAR=${POWERLINE_CONDA_PYTHON_VENV_CHAR:="❲c❳ "} | |
PYTHON_VENV_THEME_PROMPT_COLOR=35 | |
SCM_NONE_CHAR="" | |
SCM_GIT_CHAR=${POWERLINE_SCM_GIT_CHAR:=" "} | |
SCM_THEME_PROMPT_CLEAN="" | |
SCM_THEME_PROMPT_DIRTY="" | |
SCM_THEME_PROMPT_CLEAN_COLOR=25 | |
SCM_THEME_PROMPT_DIRTY_COLOR=88 | |
SCM_THEME_PROMPT_STAGED_COLOR=30 | |
SCM_THEME_PROMPT_UNSTAGED_COLOR=92 | |
SCM_THEME_PROMPT_COLOR=${SCM_THEME_PROMPT_CLEAN_COLOR} | |
RVM_THEME_PROMPT_PREFIX="" | |
RVM_THEME_PROMPT_SUFFIX="" | |
RBENV_THEME_PROMPT_PREFIX="" | |
RBENV_THEME_PROMPT_SUFFIX="" | |
RUBY_THEME_PROMPT_COLOR=161 | |
RUBY_CHAR=${POWERLINE_RUBY_CHAR:="❲r❳ "} | |
CWD_THEME_PROMPT_COLOR=240 | |
LAST_STATUS_THEME_PROMPT_COLOR=196 | |
CLOCK_THEME_PROMPT_COLOR=240 | |
BATTERY_AC_CHAR=${BATTERY_AC_CHAR:="⚡"} | |
BATTERY_STATUS_THEME_PROMPT_GOOD_COLOR=70 | |
BATTERY_STATUS_THEME_PROMPT_LOW_COLOR=208 | |
BATTERY_STATUS_THEME_PROMPT_CRITICAL_COLOR=160 | |
THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:="%H:%M:%S"} | |
IN_VIM_THEME_PROMPT_COLOR=245 | |
IN_VIM_THEME_PROMPT_TEXT="vim" | |
DOCKER_CHAR="🐳" | |
DOCKER_UP_CHAR="↑" | |
DOCKER_DOWN_CHAR="↓" | |
DOCKER_DOWN_COLOR=172 | |
DOCKER_CRASH_COLOR=196 | |
DOCKER_COLOR=27 | |
POWERLINE_LEFT_PROMPT="cwd scm" | |
POWERLINE_RIGHT_PROMPT="in_vim docker_compose clock" | |
safe_append_prompt_command __powerline_prompt_command |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment