From c10bac90ba55607fe19913d1e71571b83d8df6dc Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Sat, 28 Nov 2015 00:03:07 +0100 Subject: In Awesome-Mode either print a home-icon or a folder icon, depending in which directory the user is. --- powerlevel9k.zsh-theme | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'powerlevel9k.zsh-theme') diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 12659e5e..4c1aaa96 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -320,7 +320,14 @@ prompt_dir() { fi - "$1_prompt_segment" "$0" "blue" "$DEFAULT_COLOR" "$(print_icon 'HOME_ICON')$current_path" + local current_icon='' + if [[ "$current_path" == '~'* ]]; then + current_icon=$(print_icon 'HOME_ICON') + else + current_icon=$(print_icon 'FOLDER_ICON') + fi + + "$1_prompt_segment" "$0" "blue" "$DEFAULT_COLOR" "$current_icon$current_path" } # GO-prompt -- cgit v1.2.3 From 0dc36ee6148d0db99e3b580a7767e4f7b8f77c87 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Sat, 28 Nov 2015 11:11:10 +0100 Subject: We need to always evaluate the path for the home/folder icon mechanism to work correctly. --- powerlevel9k.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'powerlevel9k.zsh-theme') diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 4c1aaa96..47d6aa06 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -321,7 +321,7 @@ prompt_dir() { fi local current_icon='' - if [[ "$current_path" == '~'* ]]; then + if [[ $(print -P "%~") == '~'* ]]; then current_icon=$(print_icon 'HOME_ICON') else current_icon=$(print_icon 'FOLDER_ICON') -- cgit v1.2.3