summaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2016-11-30 00:35:50 +0300
committerDominik Ritter <dritter03@googlemail.com>2016-11-30 00:35:50 +0300
commit7a776dc68c3cdf05b7124317088d6c2a5ce7751f (patch)
treea9f0158be7d1518f2880e3deb9865b739b8e4e09 /powerlevel9k.zsh-theme
parentafa256f5b32babbd72ae70e888919eb801963873 (diff)
Modify dir segment to use proper states
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme16
1 files changed, 10 insertions, 6 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index da3639e1..65b88199 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -501,17 +501,21 @@ prompt_dir() {
current_path="%$((POWERLEVEL9K_SHORTEN_DIR_LENGTH+1))(c:$POWERLEVEL9K_SHORTEN_DELIMITER/:)%${POWERLEVEL9K_SHORTEN_DIR_LENGTH}c"
;;
esac
-
fi
- local current_icon=''
+ typeset -AH dir_states
+ dir_states=(
+ "DEFAULT" "FOLDER_ICON"
+ "HOME" "HOME_ICON"
+ "HOME_SUBFOLDER" "HOME_SUB_ICON"
+ )
+ local current_state="DEFAULT"
if [[ $(print -P "%~") == '~' ]]; then
- "$1_prompt_segment" "$0_HOME" "$2" "blue" "$DEFAULT_COLOR" "$current_path" 'HOME_ICON'
+ current_state="HOME"
elif [[ $(print -P "%~") == '~'* ]]; then
- "$1_prompt_segment" "$0_HOME_SUBFOLDER" "$2" "blue" "$DEFAULT_COLOR" "$current_path" 'HOME_SUB_ICON'
- else
- "$1_prompt_segment" "$0_DEFAULT" "$2" "blue" "$DEFAULT_COLOR" "$current_path" 'FOLDER_ICON'
+ current_state="HOME_SUBFOLDER"
fi
+ "$1_prompt_segment" "$0_${current_state}" "$2" "blue" "$DEFAULT_COLOR" "$current_path" "${dir_states[$current_state]}"
}
# Docker machine