Add +R for region index to bar formatting.

This commit is contained in:
Mike Meyer 2017-04-29 17:31:45 -05:00 committed by Reginald Kennedy
parent 22167bcf2f
commit 79d583b791
2 changed files with 4 additions and 0 deletions

View file

@ -215,6 +215,7 @@ It may contain the following character sequences:
.It Li "+M" Ta "Number of iconic (minimized) windows in workspace"
.It Li "+N" Ta "Screen number"
.It Li "+P" Ta "Window class and instance separated by a colon"
.It Li "+R" Ta "Region index"
.It Li "+S" Ta "Stacking algorithm"
.It Li "+T" Ta "Window instance (from WM_CLASS)"
.It Li "+U" Ta "Urgency hint"

View file

@ -2580,6 +2580,9 @@ bar_replace_seq(char *fmt, char *fmtrep, struct swm_region *r, size_t *offrep,
case 'P':
bar_window_class_instance(tmp, sizeof tmp, r);
break;
case 'R':
snprintf(tmp, sizeof tmp, "%d", get_region_index(r));
break;
case 'S':
snprintf(tmp, sizeof tmp, "%s", r->ws->stacker);
break;