From b443c9be4a718a0b2d59902eb162c3906ee38735 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Wed, 26 Aug 2015 17:24:23 +0200 Subject: [PATCH 1/2] Moved `print_icon` to top in its own section "utility functions". --- powerlevel9k.zsh-theme | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index ae9da42a..b7b7858f 100644 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -44,6 +44,21 @@ #zstyle ':vcs_info:*+*:*' debug true #set -o xtrace +################################################################ +# Utility functions +################################################################ + +function print_icon() { + local icon_name=$1 + local ICON_USER_VARIABLE=POWERLEVEL9K_${icon_name} + local USER_ICON=${(P)ICON_USER_VARIABLE} + if [[ -n "$USER_ICON" ]]; then + echo -n $USER_ICON + else + echo -n ${icons[$icon_name]} + fi +} + ################################################################ # Icons ################################################################ @@ -190,17 +205,6 @@ if [[ "$OS" == 'OSX' ]]; then fi fi -function print_icon() { - local icon_name=$1 - local ICON_USER_VARIABLE=POWERLEVEL9K_${icon_name} - local USER_ICON=${(P)ICON_USER_VARIABLE} - if [[ -n "$USER_ICON" ]]; then - echo -n $USER_ICON - else - echo -n ${icons[$icon_name]} - fi -} - ################################################################ # color scheme ################################################################ From 7535f62746c9d172d14adfe437a8573e682a12da Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Wed, 26 Aug 2015 17:35:25 +0200 Subject: [PATCH 2/2] Added a new Icon to the dir-segment. --- powerlevel9k.zsh-theme | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index b7b7858f..56ecb611 100644 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -90,6 +90,7 @@ case $POWERLEVEL9K_MODE in FREEBSD_ICON $'\U1F608 ' # 😈 LINUX_ICON $'\U1F427 ' # 🐧 SUNOS_ICON $'\U1F31E ' # 🌞 + HOME_ICON $'\UE12C' #  VCS_UNTRACKED_ICON "\UE16C" #  VCS_UNSTAGED_ICON "\UE17C" #  VCS_STAGED_ICON "\UE168" #  @@ -130,6 +131,7 @@ case $POWERLEVEL9K_MODE in FREEBSD_ICON 'BSD' LINUX_ICON 'Lx' SUNOS_ICON 'Sun' + HOME_ICON '' VCS_UNTRACKED_ICON '?' VCS_UNSTAGED_ICON "\u25CF" # ● VCS_STAGED_ICON "\u271A" # ✚ @@ -506,7 +508,7 @@ prompt_dir() { fi - $1_prompt_segment "$0" "blue" "$DEFAULT_COLOR" "$current_path" + $1_prompt_segment "$0" "blue" "$DEFAULT_COLOR" "$(print_icon 'HOME_ICON') $current_path" } # Command number (in local history)