From c10bac90ba55607fe19913d1e71571b83d8df6dc Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Sat, 28 Nov 2015 00:03:07 +0100 Subject: [PATCH 1/3] In Awesome-Mode either print a home-icon or a folder icon, depending in which directory the user is. --- functions/icons.zsh | 3 +++ powerlevel9k.zsh-theme | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/functions/icons.zsh b/functions/icons.zsh index dd256b06..0cd6bb9d 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -44,6 +44,7 @@ case $POWERLEVEL9K_MODE in LINUX_ICON $'\UE271' #  SUNOS_ICON $'\U1F31E ' # 🌞 HOME_ICON $'\UE12C ' #  + FOLDER_ICON $'\UE818 ' #  NETWORK_ICON $'\UE1AD ' #  LOAD_ICON $'\UE190 ' #  #RAM_ICON $'\UE87D' #  @@ -95,6 +96,7 @@ case $POWERLEVEL9K_MODE in LINUX_ICON $'\UF17C' #  SUNOS_ICON $'\UF185 ' #  HOME_ICON $'\UF015 ' #  + FOLDER_ICON '' NETWORK_ICON $'\UF09E ' #  LOAD_ICON $'\UF080 ' #  RAM_ICON $'\UF0E4' #  @@ -141,6 +143,7 @@ case $POWERLEVEL9K_MODE in LINUX_ICON 'Lx' SUNOS_ICON 'Sun' HOME_ICON '' + FOLDER_ICON '' NETWORK_ICON 'IP' LOAD_ICON 'L' RAM_ICON 'RAM' 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 From a09a4b8dd52511507092c3daf11438b501bd8a1c Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Sat, 28 Nov 2015 10:57:50 +0100 Subject: [PATCH 2/3] Added a folder icon for "awesome-fontconfig" mode. Thx to @tritlo --- functions/icons.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/icons.zsh b/functions/icons.zsh index 0cd6bb9d..fcf08163 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -96,7 +96,7 @@ case $POWERLEVEL9K_MODE in LINUX_ICON $'\UF17C' #  SUNOS_ICON $'\UF185 ' #  HOME_ICON $'\UF015 ' #  - FOLDER_ICON '' + FOLDER_ICON $'\UF115 ' #  NETWORK_ICON $'\UF09E ' #  LOAD_ICON $'\UF080 ' #  RAM_ICON $'\UF0E4' #  From 0dc36ee6148d0db99e3b580a7767e4f7b8f77c87 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Sat, 28 Nov 2015 11:11:10 +0100 Subject: [PATCH 3/3] 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(-) 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')