aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKayant <anthonysanwo@googlemail.com>2016-01-16 02:12:38 +0300
committerKayant <anthonysanwo@googlemail.com>2016-01-16 04:08:52 +0300
commitcf921fb90c8d239f57391cf6ae459c3d6b6420bf (patch)
tree57420ed26f890bd8ee15543c26dde3bfb10b9ad2
parent94419f54a575944075a979f84dbfc981eae8a08a (diff)
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.
-rw-r--r--README.md2
-rw-r--r--functions/icons.zsh4
-rwxr-xr-xpowerlevel9k.zsh-theme4
3 files changed, 8 insertions, 2 deletions
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