Instead of inserting sequential spaces one by one, add support for
padding with the +< character pair. Uses the specified limit or one
otherwise.
It may contain the following character sequences:
.Bl -column "Character sequence" "Replaced with" -offset indent
.It Sy "Character sequence" Ta Sy "Replaced with"
It may contain the following character sequences:
.Bl -column "Character sequence" "Replaced with" -offset indent
.It Sy "Character sequence" Ta Sy "Replaced with"
+.It Li "+<" Ta "Pad with a space"
.It Li "+A" Ta "Output of the external script"
.It Li "+C" Ta "Window class"
.It Li "+D" Ta "Workspace name"
.It Li "+A" Ta "Output of the external script"
.It Li "+C" Ta "Window class"
.It Li "+D" Ta "Workspace name"
/* only show the workspace name if there's actually one */
if (r != NULL && r->ws != NULL && r->ws->name != NULL)
strlcat(fmtnew, "<+D>", sz);
/* only show the workspace name if there's actually one */
if (r != NULL && r->ws != NULL && r->ws->name != NULL)
strlcat(fmtnew, "<+D>", sz);
- strlcat(fmtnew, " ", sz);
+ strlcat(fmtnew, "+3<", sz);
if (clock_enabled) {
strlcat(fmtnew, fmtexp, sz);
if (clock_enabled) {
strlcat(fmtnew, fmtexp, sz);
- strlcat(fmtnew, " ", sz);
+ strlcat(fmtnew, "+4<", sz);
}
/* bar_urgent already adds the space before the last asterisk */
if (urgent_enabled)
}
/* bar_urgent already adds the space before the last asterisk */
if (urgent_enabled)
- strlcat(fmtnew, "* +U* ", sz);
+ strlcat(fmtnew, "* +U*+4<", sz);
if (title_class_enabled) {
strlcat(fmtnew, "+C", sz);
if (title_name_enabled == 0)
if (title_class_enabled) {
strlcat(fmtnew, "+C", sz);
if (title_name_enabled == 0)
- strlcat(fmtnew, " ", sz);
+ strlcat(fmtnew, "+4<", sz);
}
/* checks needed by the colon and floating strlcat(3) calls below */
}
/* checks needed by the colon and floating strlcat(3) calls below */
if (title_name_enabled) {
if (title_class_enabled)
strlcat(fmtnew, ":", sz);
if (title_name_enabled) {
if (title_class_enabled)
strlcat(fmtnew, ":", sz);
- strlcat(fmtnew, "+T ", sz);
+ strlcat(fmtnew, "+T+4<", sz);
}
if (window_name_enabled) {
if (r->ws->focus->floating)
}
if (window_name_enabled) {
if (r->ws->focus->floating)
}
/* finally add the action script output and the version */
}
/* finally add the action script output and the version */
- strlcat(fmtnew, " +A +V", sz);
+ strlcat(fmtnew, "+4<+A+4<+V", sz);
}
/* replaces the bar format character sequences (like in tmux(1)) */
}
/* replaces the bar format character sequences (like in tmux(1)) */
return (fmt);
switch (*fmt) {
return (fmt);
switch (*fmt) {
+ case '<':
+ /* special case; no limit given, pad one space, instead */
+ if (limit == sizeof tmp - 1)
+ limit = 1;
+ snprintf(tmp, sizeof tmp, "%*s", limit, " ");
+ break;
case 'A':
snprintf(tmp, sizeof tmp, "%s", bar_ext);
break;
case 'A':
snprintf(tmp, sizeof tmp, "%s", bar_ext);
break;
# bar_action = baraction.sh
# bar_delay = 1
# bar_justify = left
# bar_action = baraction.sh
# bar_delay = 1
# bar_justify = left
-# bar_format = +N:+I +S <+D> %a %b %d %R %Z %Y +A +V
+# bar_format = +N:+I +S <+D>+4<%a %b %d %R %Z %Y+8<+A+4<+V
# bar_at_bottom = 1
# stack_enabled = 1
# clock_enabled = 1
# bar_at_bottom = 1
# stack_enabled = 1
# clock_enabled = 1