From: Reginald Kennedy Date: Thu, 14 May 2015 04:21:01 +0000 (+0800) Subject: Tweak the urgency indicator default padding for urgent_collapse = 1. X-Git-Tag: SPECTRWM_2_7_0~7 X-Git-Url: https://code.delx.au/spectrwm/commitdiff_plain/4e5c9bd680f3b1f130819016efd7639e18edbce8 Tweak the urgency indicator default padding for urgent_collapse = 1. e.g. * 1 3* -> *1 3* Add clarification for urgent_collapse in the man page. closes #96 --- diff --git a/spectrwm.1 b/spectrwm.1 index 811d16d..71c53de 100644 --- a/spectrwm.1 +++ b/spectrwm.1 @@ -445,8 +445,9 @@ Set this to the opposite of to collapse the border between tiles. Disable by setting to 0. .It Ic urgent_collapse -Enables hiding of placeholders in the urgency hint indicator for workspaces that -do not have any urgent windows. +Minimizes the space consumed by the urgency hint indicator by removing the +placeholders for non-urgent workspaces, the trailing space when there are +urgent windows and the default leading space. Enable by setting to 1. .It Ic urgent_enabled Enable or disable the urgency hint indicator in the status bar. diff --git a/spectrwm.c b/spectrwm.c index b894d0b..ac5d6cf 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -2280,7 +2280,7 @@ bar_fmt(const char *fmtexp, char *fmtnew, struct swm_region *r, size_t sz) /* bar_urgent already adds the space before the last asterisk */ if (urgent_enabled) - strlcat(fmtnew, "* +U*+4<", sz); + strlcat(fmtnew, (urgent_collapse ? "*+U*+4<" : "* +U*+4<"), sz); if (window_class_enabled) { strlcat(fmtnew, "+C", sz);