mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-18 13:41:56 +00:00
Add visual identifier to custom segments
This commit is contained in:
parent
743ddc1253
commit
629d52a7d5
1 changed files with 4 additions and 2 deletions
|
@ -703,11 +703,13 @@ prompt_host() {
|
||||||
# The 'custom` prompt provides a way for users to invoke commands and display
|
# The 'custom` prompt provides a way for users to invoke commands and display
|
||||||
# the output in a segment.
|
# the output in a segment.
|
||||||
prompt_custom() {
|
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})"
|
local segment_content="$(eval ${(P)command})"
|
||||||
|
|
||||||
if [[ -n $segment_content ]]; then
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue