]> code.delx.au - spectrwm/commitdiff
Add screen identifier. This doesn't do workspaces just yet.
authorMarco Peereboom <marco@conformal.com>
Tue, 20 Jan 2009 03:50:50 +0000 (03:50 +0000)
committerMarco Peereboom <marco@conformal.com>
Tue, 20 Jan 2009 03:50:50 +0000 (03:50 +0000)
scrotwm.c

index 2911c06644329b6eb990845e9a7a933e76167520..557f59e6bfca0cfce85138f8b51429fef6afdf01 100644 (file)
--- 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);
 }