aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2018-07-18 23:13:25 +0300
committerDominik Ritter <dritter03@googlemail.com>2018-07-18 23:13:25 +0300
commit629d52a7d548f055b27e79d60651f21a19aed684 (patch)
treebf7089cf9d8a14d65b6b6ece48d5d0beff656952 /powerlevel9k.zsh-theme
parent743ddc1253f49195b2e2483d66e97eb5d78b3712 (diff)
Add visual identifier to custom segments
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme6
1 files changed, 4 insertions, 2 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index eefcedde..144b4df4 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -703,11 +703,13 @@ prompt_host() {
# The 'custom` prompt provides a way for users to invoke commands and display
# the output in a segment.
prompt_custom() {
- local command=POWERLEVEL9K_CUSTOM_$3:u
+ local segment_name="${3:u}"
+ # Get content of custom segment
+ local command="POWERLEVEL9K_CUSTOM_${segment_name}"
local segment_content="$(eval ${(P)command})"
if [[ -n $segment_content ]]; then
- "$1_prompt_segment" "${0}_${3:u}" "$2" $DEFAULT_COLOR_INVERTED $DEFAULT_COLOR "$segment_content"
+ "$1_prompt_segment" "${0}_${3:u}" "$2" $DEFAULT_COLOR_INVERTED $DEFAULT_COLOR "$segment_content" "CUSTOM_${segment_name}_ICON"
fi
}