Don't prepend separator before empty window status icons (#270)
Only works for catppuccin_window_status_icon_enable = yes Co-authored-by: Aleksandr Jakusev <no@email.com>
This commit is contained in:
parent
99013fafe6
commit
3860374835
1 changed files with 13 additions and 8 deletions
|
|
@ -95,6 +95,12 @@ build_window_format() {
|
||||||
echo "$final_window_format"
|
echo "$final_window_format"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prepend_separator() {
|
||||||
|
local field="$1"
|
||||||
|
|
||||||
|
echo "${field:+ $field}"
|
||||||
|
}
|
||||||
|
|
||||||
build_window_icon() {
|
build_window_icon() {
|
||||||
# Only update `show_window_status` if it's not empty
|
# Only update `show_window_status` if it's not empty
|
||||||
# this module is ran twice once for current and once for default
|
# this module is ran twice once for current and once for default
|
||||||
|
|
@ -133,14 +139,13 @@ build_window_icon() {
|
||||||
if [ "$window_status_icon_enable" = "yes" ]; then
|
if [ "$window_status_icon_enable" = "yes" ]; then
|
||||||
# #!~[*-]MZ
|
# #!~[*-]MZ
|
||||||
show_window_status=""
|
show_window_status=""
|
||||||
show_window_status+="#{?window_activity_flag, ${custom_icon_window_activity},}"
|
show_window_status+="#{?window_activity_flag,$(prepend_separator "${custom_icon_window_activity}"),}"
|
||||||
show_window_status+="#{?window_bell_flag, ${custom_icon_window_bell},}"
|
show_window_status+="#{?window_bell_flag,$(prepend_separator "${custom_icon_window_bell}"),}"
|
||||||
show_window_status+="#{?window_silence_flag, ${custom_icon_window_silent},}"
|
show_window_status+="#{?window_silence_flag,$(prepend_separator "${custom_icon_window_silent}"),}"
|
||||||
show_window_status+="#{?window_active, ${custom_icon_window_current},}"
|
show_window_status+="#{?window_active,$(prepend_separator "${custom_icon_window_current}"),}"
|
||||||
show_window_status+="#{?window_last_flag, ${custom_icon_window_last},}"
|
show_window_status+="#{?window_last_flag,$(prepend_separator "${custom_icon_window_last}"),}"
|
||||||
show_window_status+="#{?window_marked_flag, ${custom_icon_window_mark},}"
|
show_window_status+="#{?window_marked_flag,$(prepend_separator "${custom_icon_window_mark}"),}"
|
||||||
show_window_status+="#{?window_zoomed_flag, ${custom_icon_window_zoom},}"
|
show_window_status+="#{?window_zoomed_flag,$(prepend_separator "${custom_icon_window_zoom}"),}"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$window_status_icon_enable" = "no" ]; then
|
if [ "$window_status_icon_enable" = "no" ]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue