summaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/dwm.c b/dwm.c
index b353b8e..2ce630f 100644
--- a/dwm.c
+++ b/dwm.c
@@ -143,6 +143,9 @@ struct Monitor {
#ifdef CONFIG_DWM_PERTAG
Pertag *pertag;
#endif
+#ifdef CONFIG_DWM_ALTERNATIVETAGS
+ unsigned int alttag;
+#endif
/******************************************************************************/
};
@@ -250,6 +253,12 @@ static int xerrordummy(Display *dpy, XErrorEvent *ee);
static int xerrorstart(Display *dpy, XErrorEvent *ee);
static void zoom(const Arg *arg);
+/******************************************************************************/
+#ifdef CONFIG_DWM_ALTERNATIVETAGS
+static void togglealttag();
+#endif
+/******************************************************************************/
+
/* variables */
static const char broken[] = "broken";
static char stext[256];
@@ -765,6 +774,12 @@ drawbar(Monitor *m)
unsigned int i, occ = 0, urg = 0;
Client *c;
+/******************************************************************************/
+#ifdef CONFIG_DWM_ALTERNATIVETAGS
+ int wdelta=0;
+#endif
+/******************************************************************************/
+
/* draw status first so it can be overdrawn by tags later */
if (m == selmon) { /* status is only drawn on selected monitor */
drw_setscheme(drw, scheme[SchemeNorm]);
@@ -778,6 +793,20 @@ drawbar(Monitor *m)
urg |= c->tags;
}
x = 0;
+#ifdef CONFIG_DWM_ALTERNATIVETAGS
+ for (i = 0; i < LENGTH(tags); i++) {
+ w = TEXTW(tags[i]);
+ wdelta = selmon->alttag ? abs(TEXTW(tags[i]) - TEXTW(tagsalt[i])) / 2 : 0;
+ drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
+ //drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
+ drw_text(drw, x, 0, w, bh, wdelta + lrpad / 2, (selmon->alttag ? tagsalt[i] : tags[i]), urg & 1 << i);
+ if (occ & 1 << i)
+ drw_rect(drw, x + boxs, boxs, boxw, boxw,
+ m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
+ urg & 1 << i);
+ x += w;
+ }
+#else
for (i = 0; i < LENGTH(tags); i++) {
w = TEXTW(tags[i]);
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
@@ -788,6 +817,7 @@ drawbar(Monitor *m)
urg & 1 << i);
x += w;
}
+#endif
w = blw = TEXTW(m->ltsymbol);
drw_setscheme(drw, scheme[SchemeNorm]);
x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
@@ -2303,3 +2333,12 @@ main(int argc, char *argv[])
XCloseDisplay(dpy);
return EXIT_SUCCESS;
}
+
+#ifdef CONFIG_DWM_ALTERNATIVETAGS
+void
+togglealttag()
+{
+ selmon->alttag = !selmon->alttag;
+ drawbar(selmon);
+}
+#endif