From d91314c8cf42b0ec3b096f070bbd4a78a8afdc3d Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Tue, 20 Jan 2009 03:50:50 +0000 Subject: [PATCH] Add screen identifier. This doesn't do workspaces just yet. --- scrotwm.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scrotwm.c b/scrotwm.c index 2911c06..557f59e 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -410,8 +410,9 @@ bar_update(void) time_t tmt; struct tm tm; struct swm_region *r; - int i; + int i, x; char s[SWM_BAR_MAX]; + char e[SWM_BAR_MAX]; if (bar_enabled == 0) return; @@ -420,10 +421,13 @@ bar_update(void) time(&tmt); localtime_r(&tmt, &tm); strftime(s, sizeof s, "%a %b %d %R %Z %Y", &tm); - for (i = 0; i < ScreenCount(display); i++) - TAILQ_FOREACH(r, &screens[i].rl, entry) - bar_print(r, s, 1); - + for (i = 0; i < ScreenCount(display); i++) { + x = 1; + TAILQ_FOREACH(r, &screens[i].rl, entry) { + snprintf(e, sizeof e, "%s %d", s, x++); + bar_print(r, e, 1); + } + } XSync(display, False); alarm(60); } -- 1.7.10.4