From d6584e13dac22ffa6318c9624aa76f60a3add7bf Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Fri, 23 Oct 2015 23:42:59 +0200 Subject: Extracted icons into a separate file. --- functions/icons.zsh | 200 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 functions/icons.zsh (limited to 'functions/icons.zsh') diff --git a/functions/icons.zsh b/functions/icons.zsh new file mode 100644 index 00000000..fb2683b2 --- /dev/null +++ b/functions/icons.zsh @@ -0,0 +1,200 @@ +# vim:ft=zsh ts=2 sw=2 sts=2 et fenc=utf-8 +################################################################ +# icons +# This file holds the icon definitions and +# icon-functions for the powerlevel9k-ZSH-theme +# https://github.com/bhilburn/powerlevel9k +################################################################ + +# These characters require the Powerline fonts to work properly. If you see +# boxes or bizarre characters below, your fonts are not correctly installed. If +# you do not want to install a special font, you can set `POWERLEVEL9K_MODE` to +# `compatible`. This shows all icons in regular symbols. + +# Initialize the icon list according to the user's `POWERLEVEL9K_MODE`. +typeset -gAH icons +case $POWERLEVEL9K_MODE in + 'flat'|'awesome-patched') + # Awesome-Patched Font required! See: + # https://github.com/gabrielelana/awesome-terminal-fonts/tree/patching-strategy/patched + # Set the right locale to protect special characters + local LC_ALL="" LC_CTYPE="en_US.UTF-8" + icons=( + LEFT_SEGMENT_SEPARATOR $'\UE0B0' #  + RIGHT_SEGMENT_SEPARATOR $'\UE0B2' #  + LEFT_SUBSEGMENT_SEPARATOR $'\UE0B1' #  + RIGHT_SUBSEGMENT_SEPARATOR $'\UE0B3' #  + CARRIAGE_RETURN_ICON $'\U21B5' # ↵ + ROOT_ICON $'\UE801' #  + RUBY_ICON $'\UE847' #  + AWS_ICON $'\UE895' #  + BACKGROUND_JOBS_ICON $'\UE82F ' #  + TEST_ICON $'\UE891' #  + TODO_ICON $'\U2611' # ☑ + BATTERY_ICON $'\UE894' #  + OK_ICON $'\U2713' # ✓ + FAIL_ICON $'\U2718' # ✘ + SYMFONY_ICON 'SF' + NODE_ICON $'\U2B22' # ⬢ + MULTILINE_FIRST_PROMPT_PREFIX $'\U256D'$'\U2500' + MULTILINE_SECOND_PROMPT_PREFIX $'\U2570'$'\U2500 ' + APPLE_ICON $'\UE26E' #  + FREEBSD_ICON $'\U1F608 ' # 😈 + LINUX_ICON $'\UE271' #  + SUNOS_ICON $'\U1F31E ' # 🌞 + HOME_ICON $'\UE12C ' #  + NETWORK_ICON $'\UE1AD ' #  + LOAD_ICON $'\UE190 ' #  + #RAM_ICON $'\UE87D' #  + RAM_ICON $'\UE1E2 ' #  + VCS_UNTRACKED_ICON $'\UE16C' #  + VCS_UNSTAGED_ICON $'\UE17C' #  + VCS_STAGED_ICON $'\UE168' #  + VCS_STASH_ICON $'\UE133 ' #  + #VCS_INCOMING_CHANGES_ICON $'\UE1EB ' #  + #VCS_INCOMING_CHANGES_ICON $'\UE80D ' #  + VCS_INCOMING_CHANGES_ICON $'\UE131 ' #  + #VCS_OUTGOING_CHANGES_ICON $'\UE1EC ' #  + #VCS_OUTGOING_CHANGES_ICON $'\UE80E ' #  + VCS_OUTGOING_CHANGES_ICON $'\UE132 ' #  + VCS_TAG_ICON $'\UE817 ' #  + VCS_BOOKMARK_ICON $'\UE87B' #  + VCS_COMMIT_ICON $'\UE821 ' #  + VCS_BRANCH_ICON $'\UE220' #  + VCS_REMOTE_BRANCH_ICON ' '$'\UE804 ' #  + VCS_GIT_ICON $'\UE20E ' #  + VCS_HG_ICON $'\UE1C3 ' #  + ) + ;; + 'awesome-fontconfig') + # fontconfig with awesome-font required! See + # https://github.com/gabrielelana/awesome-terminal-fonts + icons=( + LEFT_SEGMENT_SEPARATOR $'\UE0B0' #  + RIGHT_SEGMENT_SEPARATOR $'\UE0B2' #  + LEFT_SUBSEGMENT_SEPARATOR $'\UE0B1' #  + RIGHT_SUBSEGMENT_SEPARATOR $'\UE0B3' #  + CARRIAGE_RETURN_ICON $'\U21B5' # ↵ + ROOT_ICON $'\uF201' #  + RUBY_ICON $'\UF247' #  + AWS_ICON $'\UF296' #  + BACKGROUND_JOBS_ICON $'\UF013 ' #  + TEST_ICON $'\UF291' #  + TODO_ICON $'\U2611' # ☑ + BATTERY_ICON $'\u1F50B' # 🔋 + OK_ICON $'\UF23A' #  + FAIL_ICON $'\UF281' #  + SYMFONY_ICON 'SF' + NODE_ICON $'\U2B22' # ⬢ + MULTILINE_FIRST_PROMPT_PREFIX $'\U256D'$'\U2500' # ╭─ + MULTILINE_SECOND_PROMPT_PREFIX $'\U2570'$'\U2500 ' # ╰─ + APPLE_ICON $'\UF179' #  + FREEBSD_ICON $'\U1F608 ' # 😈 + LINUX_ICON $'\UF17C' #  + SUNOS_ICON $'\UF185 ' #  + HOME_ICON $'\UF015 ' #  + NETWORK_ICON $'\UF09E ' #  + LOAD_ICON $'\UF080 ' #  + RAM_ICON $'\UF0E4' #  + VCS_UNTRACKED_ICON $'\UF059' #  + VCS_UNSTAGED_ICON $'\UF06A' #  + VCS_STAGED_ICON $'\UF055' #  + VCS_STASH_ICON $'\UF01C ' #  + VCS_INCOMING_CHANGES_ICON $'\UF01A ' #  + VCS_OUTGOING_CHANGES_ICON $'\UF01B ' #  + VCS_TAG_ICON $'\UF217 ' #  + VCS_BOOKMARK_ICON $'\UF27B' #  + VCS_COMMIT_ICON $'\UF221 ' #  + VCS_BRANCH_ICON $'\UF126' #  + VCS_REMOTE_BRANCH_ICON ' '$'\UF204 ' #  + VCS_GIT_ICON $'\UF113 ' #  + VCS_HG_ICON $'\UF0C3 ' #  + ) + ;; + *) + # Powerline-Patched Font required! + # See https://github.com/Lokaltog/powerline-fonts + icons=( + LEFT_SEGMENT_SEPARATOR $'\uE0B0' #  + RIGHT_SEGMENT_SEPARATOR $'\uE0B2' #  + LEFT_SUBSEGMENT_SEPARATOR $'\UE0B1' #  + RIGHT_SUBSEGMENT_SEPARATOR $'\UE0B3' #  + CARRIAGE_RETURN_ICON $'\U21B5' # ↵ + ROOT_ICON $'\u26A1' # ⚡ + RUBY_ICON '' + AWS_ICON 'AWS:' + BACKGROUND_JOBS_ICON $'\u2699' # ⚙ + TEST_ICON '' + TODO_ICON $'\U2611' # ☑ + BATTERY_ICON $'\u1F50B' # 🔋 + OK_ICON $'\u2713' # ✓ + FAIL_ICON $'\u2718' # ✘ + SYMFONY_ICON 'SF' + NODE_ICON $'\u2B22' # ⬢ + MULTILINE_FIRST_PROMPT_PREFIX $'\u256D'$'\u2500' + MULTILINE_SECOND_PROMPT_PREFIX $'\u2570'$'\u2500 ' + APPLE_ICON 'OSX' + FREEBSD_ICON 'BSD' + LINUX_ICON 'Lx' + SUNOS_ICON 'Sun' + HOME_ICON '' + NETWORK_ICON 'IP' + LOAD_ICON 'L' + RAM_ICON 'RAM' + VCS_UNTRACKED_ICON '?' + VCS_UNSTAGED_ICON $'\u25CF' # ● + VCS_STAGED_ICON $'\u271A' # ✚ + VCS_STASH_ICON $'\u235F' # ⍟ + VCS_INCOMING_CHANGES_ICON $'\u2193' # ↓ + VCS_OUTGOING_CHANGES_ICON $'\u2191' # ↑ + VCS_TAG_ICON '' + VCS_BOOKMARK_ICON $'\u263F' # ☿ + VCS_COMMIT_ICON '' + VCS_BRANCH_ICON $'\uE0A0 ' #  + VCS_REMOTE_BRANCH_ICON $'\u2192' # → + VCS_GIT_ICON '' + VCS_HG_ICON '' + ) + ;; +esac + +# Override the above icon settings with any user-defined variables. +case $POWERLEVEL9K_MODE in + 'flat') + icons[LEFT_SEGMENT_SEPARATOR]='' + icons[RIGHT_SEGMENT_SEPARATOR]='' + icons[LEFT_SUBSEGMENT_SEPARATOR]='|' + icons[RIGHT_SUBSEGMENT_SEPARATOR]='|' + ;; + 'compatible') + # Set the right locale to protect special characters + local LC_ALL="" LC_CTYPE="en_US.UTF-8" + icons[LEFT_SEGMENT_SEPARATOR]=$'\u2B80' # ⮀ + icons[RIGHT_SEGMENT_SEPARATOR]=$'\u2B82' # ⮂ + icons[VCS_BRANCH_ICON]='@' + ;; +esac + +if [[ "$POWERLEVEL9K_HIDE_BRANCH_ICON" == true ]]; then + icons[VCS_BRANCH_ICON]='' +fi + +# Safety function for printing icons +# Prints the named icon, or if that icon is undefined, the string name. +function print_icon() { + local icon_name=$1 + local ICON_USER_VARIABLE=POWERLEVEL9K_${icon_name} + local USER_ICON=${(P)ICON_USER_VARIABLE} + if defined "$ICON_USER_VARIABLE"; then + echo -n "$USER_ICON" + else + echo -n "${icons[$icon_name]}" + fi +} + +get_icon_names() { + for key in ${(@k)icons}; do + echo "POWERLEVEL9K_$key: ${icons[$key]}" + done +} + -- cgit v1.2.3 From 231cfda8090d352ca378ea23967a19e2884d672e Mon Sep 17 00:00:00 2001 From: Matthías Páll Gissurarson Date: Tue, 17 Nov 2015 21:18:31 +0100 Subject: added icon to be able to set the end of the prompt explicitly --- functions/icons.zsh | 3 +++ powerlevel9k.zsh-theme | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'functions/icons.zsh') diff --git a/functions/icons.zsh b/functions/icons.zsh index fb2683b2..dd256b06 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -22,6 +22,7 @@ case $POWERLEVEL9K_MODE in icons=( LEFT_SEGMENT_SEPARATOR $'\UE0B0' #  RIGHT_SEGMENT_SEPARATOR $'\UE0B2' #  + LEFT_SEGMENT_END_SEPARATOR ' ' # Whitespace LEFT_SUBSEGMENT_SEPARATOR $'\UE0B1' #  RIGHT_SUBSEGMENT_SEPARATOR $'\UE0B3' #  CARRIAGE_RETURN_ICON $'\U21B5' # ↵ @@ -72,6 +73,7 @@ case $POWERLEVEL9K_MODE in icons=( LEFT_SEGMENT_SEPARATOR $'\UE0B0' #  RIGHT_SEGMENT_SEPARATOR $'\UE0B2' #  + LEFT_SEGMENT_END_SEPARATOR ' ' # Whitespace LEFT_SUBSEGMENT_SEPARATOR $'\UE0B1' #  RIGHT_SUBSEGMENT_SEPARATOR $'\UE0B3' #  CARRIAGE_RETURN_ICON $'\U21B5' # ↵ @@ -117,6 +119,7 @@ case $POWERLEVEL9K_MODE in icons=( LEFT_SEGMENT_SEPARATOR $'\uE0B0' #  RIGHT_SEGMENT_SEPARATOR $'\uE0B2' #  + LEFT_SEGMENT_END_SEPARATOR ' ' # Whitespace LEFT_SUBSEGMENT_SEPARATOR $'\UE0B1' #  RIGHT_SUBSEGMENT_SEPARATOR $'\UE0B3' #  CARRIAGE_RETURN_ICON $'\U21B5' # ↵ diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index cdcb9a96..f9249da7 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -144,7 +144,7 @@ left_prompt_end() { else echo -n "%k" fi - echo -n "%f " + echo -n "%{%f%}$(print_icon 'LEFT_SEGMENT_END_SEPARATOR')" CURRENT_BG='' } -- cgit v1.2.3 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. --- functions/icons.zsh | 3 +++ powerlevel9k.zsh-theme | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'functions/icons.zsh') 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 -- cgit v1.2.3 From a09a4b8dd52511507092c3daf11438b501bd8a1c Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Sat, 28 Nov 2015 10:57:50 +0100 Subject: Added a folder icon for "awesome-fontconfig" mode. Thx to @tritlo --- functions/icons.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'functions/icons.zsh') 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' #  -- cgit v1.2.3 From 71510361984568408f8dc87251c1a9e2abdddef2 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Tue, 15 Dec 2015 00:31:09 +0100 Subject: Removed unecessary variable. --- functions/icons.zsh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'functions/icons.zsh') diff --git a/functions/icons.zsh b/functions/icons.zsh index fcf08163..48396ff5 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -190,9 +190,8 @@ fi function print_icon() { local icon_name=$1 local ICON_USER_VARIABLE=POWERLEVEL9K_${icon_name} - local USER_ICON=${(P)ICON_USER_VARIABLE} if defined "$ICON_USER_VARIABLE"; then - echo -n "$USER_ICON" + echo -n "${(P)ICON_USER_VARIABLE}" else echo -n "${icons[$icon_name]}" fi -- cgit v1.2.3 From 46aafc797a21926734d5c40c56d68e55c8c845e3 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Tue, 15 Dec 2015 02:34:23 +0100 Subject: Some icons are visual identifiers now, so they shouldn't control the margin to the text (which is whitespace). --- functions/icons.zsh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'functions/icons.zsh') diff --git a/functions/icons.zsh b/functions/icons.zsh index 48396ff5..4ba4811e 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -43,9 +43,9 @@ case $POWERLEVEL9K_MODE in FREEBSD_ICON $'\U1F608 ' # 😈 LINUX_ICON $'\UE271' #  SUNOS_ICON $'\U1F31E ' # 🌞 - HOME_ICON $'\UE12C ' #  - FOLDER_ICON $'\UE818 ' #  - NETWORK_ICON $'\UE1AD ' #  + HOME_ICON $'\UE12C' #  + FOLDER_ICON $'\UE818' #  + NETWORK_ICON $'\UE1AD' #  LOAD_ICON $'\UE190 ' #  #RAM_ICON $'\UE87D' #  RAM_ICON $'\UE1E2 ' #  @@ -95,9 +95,9 @@ case $POWERLEVEL9K_MODE in FREEBSD_ICON $'\U1F608 ' # 😈 LINUX_ICON $'\UF17C' #  SUNOS_ICON $'\UF185 ' #  - HOME_ICON $'\UF015 ' #  - FOLDER_ICON $'\UF115 ' #  - NETWORK_ICON $'\UF09E ' #  + HOME_ICON $'\UF015' #  + FOLDER_ICON $'\UF115' #  + NETWORK_ICON $'\UF09E' #  LOAD_ICON $'\UF080 ' #  RAM_ICON $'\UF0E4' #  VCS_UNTRACKED_ICON $'\UF059' #  -- cgit v1.2.3 From ac4502ca1fafab54c07d22e4841d8c6c7aeffc95 Mon Sep 17 00:00:00 2001 From: Dominik Ritter Date: Fri, 18 Dec 2015 00:47:37 +0100 Subject: Added the "visual identifier" concept to the `vcs` segment. --- functions/icons.zsh | 8 ++++---- functions/vcs.zsh | 6 ++++++ powerlevel9k.zsh-theme | 11 +++++------ 3 files changed, 15 insertions(+), 10 deletions(-) (limited to 'functions/icons.zsh') diff --git a/functions/icons.zsh b/functions/icons.zsh index 4ba4811e..b8e02efd 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -64,8 +64,8 @@ case $POWERLEVEL9K_MODE in VCS_COMMIT_ICON $'\UE821 ' #  VCS_BRANCH_ICON $'\UE220' #  VCS_REMOTE_BRANCH_ICON ' '$'\UE804 ' #  - VCS_GIT_ICON $'\UE20E ' #  - VCS_HG_ICON $'\UE1C3 ' #  + VCS_GIT_ICON $'\UE20E ' #  + VCS_HG_ICON $'\UE1C3 ' #  ) ;; 'awesome-fontconfig') @@ -111,8 +111,8 @@ case $POWERLEVEL9K_MODE in VCS_COMMIT_ICON $'\UF221 ' #  VCS_BRANCH_ICON $'\UF126' #  VCS_REMOTE_BRANCH_ICON ' '$'\UF204 ' #  - VCS_GIT_ICON $'\UF113 ' #  - VCS_HG_ICON $'\UF0C3 ' #  + VCS_GIT_ICON $'\UF113 ' #  + VCS_HG_ICON $'\UF0C3 ' #  ) ;; *) diff --git a/functions/vcs.zsh b/functions/vcs.zsh index 39d0fdae..49dccc18 100644 --- a/functions/vcs.zsh +++ b/functions/vcs.zsh @@ -78,6 +78,12 @@ function +vi-hg-bookmarks() { } function +vi-vcs-detect-changes() { + if [[ "${hook_com[vcs]}" == "git" ]]; then + vcs_visual_identifier='VCS_GIT_ICON' + elif [[ "${hook_com[vcs]}" == "hg" ]]; then + vcs_visual_identifier='VCS_HG_ICON' + fi + if [[ -n "${hook_com[staged]}" ]] || [[ -n "${hook_com[unstaged]}" ]]; then VCS_WORKDIR_DIRTY=true else diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index bf35967a..5e089521 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -696,8 +696,7 @@ prompt_vcs() { zstyle ':vcs_info:*' check-for-changes true VCS_DEFAULT_FORMAT="$VCS_CHANGESET_PREFIX%F{$POWERLEVEL9K_VCS_FOREGROUND}%b%c%u%m%f" - zstyle ':vcs_info:git*:*' formats "%F{$POWERLEVEL9K_VCS_FOREGROUND}$(print_icon 'VCS_GIT_ICON')%f$VCS_DEFAULT_FORMAT" - zstyle ':vcs_info:hg*:*' formats "%F{$POWERLEVEL9K_VCS_FOREGROUND}$(print_icon 'VCS_HG_ICON')%f$VCS_DEFAULT_FORMAT" + zstyle ':vcs_info:*' formats "$VCS_DEFAULT_FORMAT" zstyle ':vcs_info:*' actionformats "%b %F{red}| %a%f" @@ -724,12 +723,12 @@ prompt_vcs() { if [[ -n "$vcs_prompt" ]]; then if [[ "$VCS_WORKDIR_DIRTY" == true ]]; then - "$1_prompt_segment" "$0_MODIFIED" "yellow" "$DEFAULT_COLOR" + # $vcs_visual_identifier gets set in +vi-vcs-detect-changes in functions/vcs.zsh, + # as we have there access to vcs_info internal hooks. + "$1_prompt_segment" "$0_MODIFIED" "yellow" "$DEFAULT_COLOR" "$vcs_prompt" "$vcs_visual_identifier" else - "$1_prompt_segment" "$0" "green" "$DEFAULT_COLOR" + "$1_prompt_segment" "$0" "green" "$DEFAULT_COLOR" "$vcs_prompt" "$vcs_visual_identifier" fi - - echo -n "$vcs_prompt " fi } -- cgit v1.2.3 From a97fa07cc5851116e633bdb38b632bde4e51818f Mon Sep 17 00:00:00 2001 From: MrTuxHdb Date: Wed, 13 Jan 2016 00:51:51 +0700 Subject: [FIX] RUBY_ICON should be $'\UF219' --- functions/icons.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'functions/icons.zsh') diff --git a/functions/icons.zsh b/functions/icons.zsh index b8e02efd..a0171e69 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -79,7 +79,7 @@ case $POWERLEVEL9K_MODE in RIGHT_SUBSEGMENT_SEPARATOR $'\UE0B3' #  CARRIAGE_RETURN_ICON $'\U21B5' # ↵ ROOT_ICON $'\uF201' #  - RUBY_ICON $'\UF247' #  + RUBY_ICON $'\UF219' #  AWS_ICON $'\UF296' #  BACKGROUND_JOBS_ICON $'\UF013 ' #  TEST_ICON $'\UF291' #  -- cgit v1.2.3 From cf921fb90c8d239f57391cf6ae459c3d6b6420bf Mon Sep 17 00:00:00 2001 From: Kayant Date: Fri, 15 Jan 2016 23:12:38 +0000 Subject: Add sub folder icon when in home subdirectories Big thanks to @dritter for guidance, @rjorgenson for great explanation. And @bhilburn for further guidance and encouragement. See http://i.imgur.com/2Vncypo.png for a presentation of how it looks. --- README.md | 2 ++ functions/icons.zsh | 4 +++- powerlevel9k.zsh-theme | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'functions/icons.zsh') diff --git a/README.md b/README.md index 9a5f7b12..520ee440 100644 --- a/README.md +++ b/README.md @@ -210,11 +210,13 @@ others whole directories. | `Compatible` | `Powerline` | `Awesome Powerline` | Situation |------------|-----------|-------------------|---------------------------- | None | None | ![home icon](https://cloud.githubusercontent.com/assets/1544760/12183451/40ec4016-b58f-11e5-9b9e-74e2b2f0b8b3.png) | Within Home folder | +| None | None | ![home sub_icon](https://cloud.githubusercontent.com/assets/1544760/12369315/8a5d762c-bbf5-11e5-8a20-ca1179f48d6c.png) | Within Home sub folder | | None | None | ![folder icon](https://cloud.githubusercontent.com/assets/1544760/12183452/40f79286-b58f-11e5-9b8c-ed1343a07b08.png) | Outside of home folder | To turn off these icons you could set these variables to an empty string. POWERLEVEL9K_HOME_ICON='' + POWERLEVEL9K_HOME_SUB_ICON='' POWERLEVEL9K_FOLDER_ICON='' ##### ip diff --git a/functions/icons.zsh b/functions/icons.zsh index a0171e69..6a9b044c 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' #  + HOME_SUB_ICON $'\UE18D' #  FOLDER_ICON $'\UE818' #  NETWORK_ICON $'\UE1AD' #  LOAD_ICON $'\UE190 ' #  @@ -96,6 +97,7 @@ case $POWERLEVEL9K_MODE in LINUX_ICON $'\UF17C' #  SUNOS_ICON $'\UF185 ' #  HOME_ICON $'\UF015' #  + HOME_SUB_ICON $'\UF07C' #  FOLDER_ICON $'\UF115' #  NETWORK_ICON $'\UF09E' #  LOAD_ICON $'\UF080 ' #  @@ -143,6 +145,7 @@ case $POWERLEVEL9K_MODE in LINUX_ICON 'Lx' SUNOS_ICON 'Sun' HOME_ICON '' + HOME_SUB_ICON '' FOLDER_ICON '' NETWORK_ICON 'IP' LOAD_ICON 'L' @@ -202,4 +205,3 @@ get_icon_names() { echo "POWERLEVEL9K_$key: ${icons[$key]}" done } - diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 119d31e2..c3b12759 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -429,8 +429,10 @@ prompt_dir() { fi local current_icon='' - if [[ $(print -P "%~") == '~'* ]]; then + if [[ $(print -P "%~") == '~' ]]; then "$1_prompt_segment" "$0_HOME" "$2" "blue" "$DEFAULT_COLOR" "$current_path" 'HOME_ICON' + 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' fi -- cgit v1.2.3 From f1486620e742e8e8ff843cb65eea42d320752c0e Mon Sep 17 00:00:00 2001 From: rjorgenson Date: Sat, 16 Jan 2016 18:03:31 -0700 Subject: added space to end of RVM icon --- functions/icons.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'functions/icons.zsh') diff --git a/functions/icons.zsh b/functions/icons.zsh index 6a9b044c..aad62dc1 100644 --- a/functions/icons.zsh +++ b/functions/icons.zsh @@ -27,7 +27,7 @@ case $POWERLEVEL9K_MODE in RIGHT_SUBSEGMENT_SEPARATOR $'\UE0B3' #  CARRIAGE_RETURN_ICON $'\U21B5' # ↵ ROOT_ICON $'\UE801' #  - RUBY_ICON $'\UE847' #  + RUBY_ICON $'\UE847 ' #  AWS_ICON $'\UE895' #  BACKGROUND_JOBS_ICON $'\UE82F ' #  TEST_ICON $'\UE891' #  @@ -80,7 +80,7 @@ case $POWERLEVEL9K_MODE in RIGHT_SUBSEGMENT_SEPARATOR $'\UE0B3' #  CARRIAGE_RETURN_ICON $'\U21B5' # ↵ ROOT_ICON $'\uF201' #  - RUBY_ICON $'\UF219' #  + RUBY_ICON $'\UF219 ' #  AWS_ICON $'\UF296' #  BACKGROUND_JOBS_ICON $'\UF013 ' #  TEST_ICON $'\UF291' #  -- cgit v1.2.3