From 35c29349bd9f19f01bc36a9b0612e0a44a54d014 Mon Sep 17 00:00:00 2001 From: Dan Flies Date: Fri, 8 Dec 2017 09:22:35 -0600 Subject: [PATCH] Added new wd function to powerline-flies theme. Changed the __powerline_prompt_command function to reflect the base function. --- themes/powerline-flies/powerline-flies.base.bash | 13 +++++++++---- themes/powerline-flies/powerline-flies.theme.bash | 9 +++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/themes/powerline-flies/powerline-flies.base.bash b/themes/powerline-flies/powerline-flies.base.bash index 83b5ac92..5a78d70a 100644 --- a/themes/powerline-flies/powerline-flies.base.bash +++ b/themes/powerline-flies/powerline-flies.base.bash @@ -1,6 +1,6 @@ . "$BASH_IT/themes/powerline/powerline.base.bash" -function __powerline_cwd_prompt { +function __powerline_wd_prompt { echo "\W|${CWD_THEME_PROMPT_COLOR}" } @@ -15,8 +15,11 @@ function __powerline_left_segment { function __powerline_prompt_command { local last_status="$?" ## always the first + local separator_char="${POWERLINE_PROMPT_CHAR}" LEFT_PROMPT="" + SEGMENTS_AT_LEFT=0 + LAST_SEGMENT_COLOR="" ## left prompt ## for segment in $POWERLINE_PROMPT; do @@ -24,10 +27,12 @@ function __powerline_prompt_command { [[ -n "${info}" ]] && __powerline_left_segment "${info}" done [[ "${last_status}" -ne 0 ]] && __powerline_left_segment $(__powerline_last_status_prompt ${last_status}) - [[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -) ${normal}" + [[ -n "${LEFT_PROMPT}" ]] && LEFT_PROMPT+="$(set_color ${LAST_SEGMENT_COLOR} -)${separator_char}${normal}" - PS1="${LEFT_PROMPT} " + PS1="${LEFT_PROMPT}" ## cleanup ## - unset LEFT_PROMPT + unset LAST_SEGMENT_COLOR \ + LEFT_PROMPT \ + SEGMENTS_AT_LEFT } diff --git a/themes/powerline-flies/powerline-flies.theme.bash b/themes/powerline-flies/powerline-flies.theme.bash index c46fdc4c..d5d0d035 100644 --- a/themes/powerline-flies/powerline-flies.theme.bash +++ b/themes/powerline-flies/powerline-flies.theme.bash @@ -2,7 +2,7 @@ . "$BASH_IT/themes/powerline-flies/powerline-flies.base.bash" -USER_INFO_SSH_CHAR=${POWERLINE_USER_INFO_SSH_CHAR:="⌁ "} +USER_INFO_SSH_CHAR=${POWERLINE_USER_INFO_SSH_CHAR:="⌁"} USER_INFO_THEME_PROMPT_COLOR=32 USER_INFO_THEME_PROMPT_COLOR_SUDO=202 @@ -33,7 +33,7 @@ LAST_STATUS_THEME_PROMPT_COLOR=52 CLOCK_THEME_PROMPT_COLOR=240 -BATTERY_AC_CHAR=${BATTERY_AC_CHAR:="+ "} +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 @@ -43,6 +43,7 @@ THEME_CLOCK_FORMAT=${THEME_CLOCK_FORMAT:="%H:%M:%S"} IN_VIM_THEME_PROMPT_COLOR=245 IN_VIM_THEME_PROMPT_TEXT="vim" -POWERLINE_PROMPT=${POWERLINE_PROMPT:="user_info scm python_venv cwd"} +POWERLINE_PROMPT_CHAR="$ " +POWERLINE_PROMPT=${POWERLINE_PROMPT:="user_info scm python_venv wd"} -safe_append_prompt_command __powerline_prompt_command \ No newline at end of file +safe_append_prompt_command __powerline_prompt_command