From 79d583b79129fd84b7eb8b9b1c48d42930661903 Mon Sep 17 00:00:00 2001 From: Mike Meyer Date: Sat, 29 Apr 2017 17:31:45 -0500 Subject: [PATCH] Add +R for region index to bar formatting. --- spectrwm.1 | 1 + spectrwm.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/spectrwm.1 b/spectrwm.1 index 3e9cb3f..934d18d 100644 --- a/spectrwm.1 +++ b/spectrwm.1 @@ -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" diff --git a/spectrwm.c b/spectrwm.c index ece5d87..c41abb9 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -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;