summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch')
-rw-r--r--patch/awesomebar.c67
-rw-r--r--patch/awesomebar.h4
-rw-r--r--patch/bar_alpha.c (renamed from patch/alpha.c)2
-rw-r--r--patch/bar_alpha.h (renamed from patch/alpha.h)0
-rw-r--r--patch/bar_alternativetags.c (renamed from patch/alternativetags.c)0
-rw-r--r--patch/bar_alternativetags.h (renamed from patch/alternativetags.h)0
-rw-r--r--patch/bar_awesomebar.c157
-rw-r--r--patch/bar_awesomebar.h8
-rw-r--r--patch/bar_dwmblocks.c (renamed from patch/dwmblocks.c)0
-rw-r--r--patch/bar_dwmblocks.h (renamed from patch/dwmblocks.h)0
-rw-r--r--patch/bar_ewmhtags.c (renamed from patch/ewmhtags.c)0
-rw-r--r--patch/bar_ewmhtags.h (renamed from patch/ewmhtags.h)0
-rw-r--r--patch/bar_fancybar.c89
-rw-r--r--patch/bar_fancybar.h3
-rw-r--r--patch/bar_holdbar.c37
-rw-r--r--patch/bar_holdbar.h2
-rw-r--r--patch/bar_ltsymbol.c21
-rw-r--r--patch/bar_ltsymbol.h3
-rw-r--r--patch/bar_status.c49
-rw-r--r--patch/bar_status.h9
-rw-r--r--patch/bar_status2d.c (renamed from patch/status2d.c)135
-rw-r--r--patch/bar_status2d.h13
-rw-r--r--patch/bar_status2d_eb.h2
-rw-r--r--patch/bar_statusbutton.c21
-rw-r--r--patch/bar_statusbutton.h3
-rw-r--r--patch/bar_statuscmd.c76
-rw-r--r--patch/bar_statuscmd.h6
-rw-r--r--patch/bar_statuscolors.c (renamed from patch/statuscolors.c)4
-rw-r--r--patch/bar_systray.c (renamed from patch/systray.c)157
-rw-r--r--patch/bar_systray.h (renamed from patch/systray.h)9
-rw-r--r--patch/bar_taggrid.c166
-rw-r--r--patch/bar_taggrid.h4
-rw-r--r--patch/bar_tags.c125
-rw-r--r--patch/bar_tags.h3
-rw-r--r--patch/bar_vtcolors.c (renamed from patch/vtcolors.c)0
-rw-r--r--patch/bar_vtcolors.h (renamed from patch/vtcolors.h)0
-rw-r--r--patch/bar_wintitle.c88
-rw-r--r--patch/bar_wintitle.h3
-rw-r--r--patch/combo.c4
-rw-r--r--patch/combo.h4
-rw-r--r--patch/holdbar.c99
-rw-r--r--patch/holdbar.h3
-rw-r--r--patch/include.c128
-rw-r--r--patch/include.h122
-rw-r--r--patch/killunsel.c4
-rw-r--r--patch/layout_bstack.c (renamed from patch/bstack.c)0
-rw-r--r--patch/layout_bstack.h (renamed from patch/bstack.h)0
-rw-r--r--patch/layout_bstackhoriz.c (renamed from patch/bstackhoriz.c)0
-rw-r--r--patch/layout_bstackhoriz.h (renamed from patch/bstackhoriz.h)0
-rw-r--r--patch/layout_centeredfloatingmaster.c (renamed from patch/centeredfloatingmaster.c)0
-rw-r--r--patch/layout_centeredfloatingmaster.h (renamed from patch/centeredfloatingmaster.h)0
-rw-r--r--patch/layout_centeredmaster.c (renamed from patch/centeredmaster.c)0
-rw-r--r--patch/layout_centeredmaster.h (renamed from patch/centeredmaster.h)0
-rw-r--r--patch/layout_columns.c (renamed from patch/columns.c)0
-rw-r--r--patch/layout_columns.h (renamed from patch/columns.h)0
-rw-r--r--patch/layout_deck.c (renamed from patch/deck.c)0
-rw-r--r--patch/layout_deck.h (renamed from patch/deck.h)0
-rw-r--r--patch/layout_fibonacci.c (renamed from patch/fibonacci.c)0
-rw-r--r--patch/layout_fibonacci.h (renamed from patch/fibonacci.h)0
-rw-r--r--patch/layout_flextile-deluxe.c (renamed from patch/flextile-deluxe.c)0
-rw-r--r--patch/layout_flextile-deluxe.h (renamed from patch/flextile-deluxe.h)0
-rw-r--r--patch/layout_gapplessgrid.c (renamed from patch/gapplessgrid.c)0
-rw-r--r--patch/layout_gapplessgrid.h (renamed from patch/gapplessgrid.h)0
-rw-r--r--patch/layout_grid.c (renamed from patch/grid.c)0
-rw-r--r--patch/layout_grid.h (renamed from patch/grid.h)0
-rw-r--r--patch/layout_horizgrid.c (renamed from patch/horizgrid.c)0
-rw-r--r--patch/layout_horizgrid.h (renamed from patch/horizgrid.h)0
-rw-r--r--patch/layout_monocle.c (renamed from patch/monocle.c)0
-rw-r--r--patch/layout_monocle.h (renamed from patch/monocle.h)0
-rw-r--r--patch/layout_nrowgrid.c (renamed from patch/nrowgrid.c)0
-rw-r--r--patch/layout_nrowgrid.h (renamed from patch/nrowgrid.h)0
-rw-r--r--patch/layout_tile.c (renamed from patch/tile.c)0
-rw-r--r--patch/layout_tile.h (renamed from patch/tile.h)0
-rw-r--r--patch/movestack.c5
-rw-r--r--patch/status2d.h2
-rw-r--r--patch/statuscmd.c18
-rw-r--r--patch/statuscmd.h1
-rw-r--r--patch/taggrid.c118
-rw-r--r--patch/taggrid.h2
-rw-r--r--patch/xrdb.c14
80 files changed, 1191 insertions, 599 deletions
diff --git a/patch/awesomebar.c b/patch/awesomebar.c
deleted file mode 100644
index e21f4f1..0000000
--- a/patch/awesomebar.c
+++ /dev/null
@@ -1,67 +0,0 @@
-void
-hide(Client *c) {
-
- if (!c || HIDDEN(c))
- return;
-
- Window w = c->win;
- static XWindowAttributes ra, ca;
-
- // more or less taken directly from blackbox's hide() function
- XGrabServer(dpy);
- XGetWindowAttributes(dpy, root, &ra);
- XGetWindowAttributes(dpy, w, &ca);
- // prevent UnmapNotify events
- XSelectInput(dpy, root, ra.your_event_mask & ~SubstructureNotifyMask);
- XSelectInput(dpy, w, ca.your_event_mask & ~StructureNotifyMask);
- XUnmapWindow(dpy, w);
- setclientstate(c, IconicState);
- XSelectInput(dpy, root, ra.your_event_mask);
- XSelectInput(dpy, w, ca.your_event_mask);
- XUngrabServer(dpy);
-
- focus(c->snext);
- arrange(c->mon);
-}
-
-void
-show(Client *c)
-{
- if (!c || !HIDDEN(c))
- return;
-
- XMapWindow(dpy, c->win);
- setclientstate(c, NormalState);
- arrange(c->mon);
-}
-
-void
-togglewin(const Arg *arg)
-{
- Client *c = (Client*)arg->v;
- if (c == selmon->sel)
- hide(c);
- else {
- if (HIDDEN(c))
- show(c);
- focus(c);
- restack(selmon);
- }
-}
-
-void
-showhideclient(const Arg *arg)
-{
- Client *c = (Client*)arg->v;
- if (!c)
- c = selmon->sel;
- if (!c)
- return;
-
- if (HIDDEN(c)) {
- show(c);
- restack(selmon);
- } else {
- hide(c);
- }
-} \ No newline at end of file
diff --git a/patch/awesomebar.h b/patch/awesomebar.h
deleted file mode 100644
index 8cf46f4..0000000
--- a/patch/awesomebar.h
+++ /dev/null
@@ -1,4 +0,0 @@
-static void hide(Client *c);
-static void show(Client *c);
-static void togglewin(const Arg *arg);
-static void showhideclient(const Arg *arg); \ No newline at end of file
diff --git a/patch/alpha.c b/patch/bar_alpha.c
index 7da7215..d86bc1d 100644
--- a/patch/alpha.c
+++ b/patch/bar_alpha.c
@@ -34,7 +34,7 @@ xinitvisual()
XFree(infos);
- if (! visual) {
+ if (!visual) {
visual = DefaultVisual(dpy, screen);
depth = DefaultDepth(dpy, screen);
cmap = DefaultColormap(dpy, screen);
diff --git a/patch/alpha.h b/patch/bar_alpha.h
index 3c81522..3c81522 100644
--- a/patch/alpha.h
+++ b/patch/bar_alpha.h
diff --git a/patch/alternativetags.c b/patch/bar_alternativetags.c
index 3c329bc..3c329bc 100644
--- a/patch/alternativetags.c
+++ b/patch/bar_alternativetags.c
diff --git a/patch/alternativetags.h b/patch/bar_alternativetags.h
index 2c130f3..2c130f3 100644
--- a/patch/alternativetags.h
+++ b/patch/bar_alternativetags.h
diff --git a/patch/bar_awesomebar.c b/patch/bar_awesomebar.c
new file mode 100644
index 0000000..446b547
--- /dev/null
+++ b/patch/bar_awesomebar.c
@@ -0,0 +1,157 @@
+int
+width_awesomebar(Bar *bar, BarWidthArg *a)
+{
+ return a->max_width;
+}
+
+int
+draw_awesomebar(Bar *bar, BarDrawArg *a)
+{
+ int n = 0, scm, remainder = 0, tabw;
+ unsigned int i;
+ #if BAR_TITLE_LEFT_PAD && BAR_TITLE_RIGHT_PAD
+ int x = a->x + lrpad / 2, w = a->w - lrpad;
+ #elif BAR_TITLE_LEFT_PAD
+ int x = a->x + lrpad / 2, w = a->w - lrpad / 2;
+ #elif BAR_TITLE_RIGHT_PAD
+ int x = a->x, w = a->w - lrpad / 2;
+ #else
+ int x = a->x, w = a->w;
+ #endif // BAR_TITLE_LEFT_PAD | BAR_TITLE_RIGHT_PAD
+
+ Client *c;
+ for (c = bar->mon->clients; c; c = c->next)
+ if (ISVISIBLE(c))
+ n++;
+
+ if (n > 0) {
+ remainder = w % n;
+ tabw = w / n;
+ for (i = 0, c = bar->mon->clients; c; c = c->next, i++) {
+ if (!ISVISIBLE(c))
+ continue;
+ if (bar->mon->sel == c)
+ #if BAR_VTCOLORS_PATCH
+ scm = SchemeTitleSel;
+ #elif BAR_TITLECOLOR_PATCH
+ scm = SchemeTitle;
+ #else
+ scm = SchemeSel;
+ #endif // BAR_VTCOLORS_PATCH / BAR_TITLECOLOR_PATCH
+ else if (HIDDEN(c))
+ scm = SchemeHid;
+ else
+ #if BAR_VTCOLORS_PATCH
+ scm = SchemeTitleNorm;
+ #else
+ scm = SchemeNorm;
+ #endif // BAR_VTCOLORS_PATCH
+
+ drw_setscheme(drw, scheme[scm]);
+ tabw += (i < remainder ? 1 : 0);
+ #if BAR_PANGO_PATCH
+ drw_text(drw, x, 0, tabw, bh, lrpad / 2, c->name, 0, False);
+ #else
+ drw_text(drw, x, 0, tabw, bh, lrpad / 2, c->name, 0);
+ #endif // BAR_PANGO_PATCH
+ x += tabw;
+ }
+ }
+ return a->x + a->w;
+}
+
+int
+click_awesomebar(Bar *bar, Arg *arg, BarClickArg *a)
+{
+ int x = 0, n = 0;
+ Client *c;
+
+ for (c = bar->mon->clients; c; c = c->next)
+ if (ISVISIBLE(c))
+ n++;
+
+ c = bar->mon->clients;
+
+ do {
+ if (!c || !ISVISIBLE(c))
+ continue;
+ else
+ x += (1.0 / (double)n) * a->rel_w;
+ } while (c && a->rel_x > x && (c = c->next));
+
+ if (c) {
+ arg->v = c;
+ return ClkWinTitle;
+ }
+ return -1;
+}
+
+void
+hide(Client *c) {
+
+ if (!c || HIDDEN(c))
+ return;
+
+ Window w = c->win;
+ static XWindowAttributes ra, ca;
+
+ // more or less taken directly from blackbox's hide() function
+ XGrabServer(dpy);
+ XGetWindowAttributes(dpy, root, &ra);
+ XGetWindowAttributes(dpy, w, &ca);
+ // prevent UnmapNotify events
+ XSelectInput(dpy, root, ra.your_event_mask & ~SubstructureNotifyMask);
+ XSelectInput(dpy, w, ca.your_event_mask & ~StructureNotifyMask);
+ XUnmapWindow(dpy, w);
+ setclientstate(c, IconicState);
+ XSelectInput(dpy, root, ra.your_event_mask);
+ XSelectInput(dpy, w, ca.your_event_mask);
+ XUngrabServer(dpy);
+
+ focus(c->snext);
+ arrange(c->mon);
+}
+
+void
+show(Client *c)
+{
+ if (!c || !HIDDEN(c))
+ return;
+
+ XMapWindow(dpy, c->win);
+ setclientstate(c, NormalState);
+ arrange(c->mon);
+}
+
+void
+togglewin(const Arg *arg)
+{
+ Client *c = (Client*)arg->v;
+ if (!c)
+ return;
+ if (c == selmon->sel)
+ hide(c);
+ else {
+ if (HIDDEN(c))
+ show(c);
+ focus(c);
+ restack(selmon);
+ }
+}
+
+void
+showhideclient(const Arg *arg)
+{
+ Client *c = (Client*)arg->v;
+ if (!c)
+ c = selmon->sel;
+ if (!c)
+ return;
+
+ if (HIDDEN(c)) {
+ show(c);
+ restack(selmon);
+ } else {
+ hide(c);
+ }
+} \ No newline at end of file
diff --git a/patch/bar_awesomebar.h b/patch/bar_awesomebar.h
new file mode 100644
index 0000000..a99986e
--- /dev/null
+++ b/patch/bar_awesomebar.h
@@ -0,0 +1,8 @@
+static int width_awesomebar(Bar *bar, BarWidthArg *a);
+static int draw_awesomebar(Bar *bar, BarDrawArg *a);
+static int click_awesomebar(Bar *bar, Arg *arg, BarClickArg *a);
+
+static void hide(Client *c);
+static void show(Client *c);
+static void togglewin(const Arg *arg);
+static void showhideclient(const Arg *arg); \ No newline at end of file
diff --git a/patch/dwmblocks.c b/patch/bar_dwmblocks.c
index 442b0bc..442b0bc 100644
--- a/patch/dwmblocks.c
+++ b/patch/bar_dwmblocks.c
diff --git a/patch/dwmblocks.h b/patch/bar_dwmblocks.h
index f08f1d5..f08f1d5 100644
--- a/patch/dwmblocks.h
+++ b/patch/bar_dwmblocks.h
diff --git a/patch/ewmhtags.c b/patch/bar_ewmhtags.c
index 682d900..682d900 100644
--- a/patch/ewmhtags.c
+++ b/patch/bar_ewmhtags.c
diff --git a/patch/ewmhtags.h b/patch/bar_ewmhtags.h
index 2ec890e..2ec890e 100644
--- a/patch/ewmhtags.h
+++ b/patch/bar_ewmhtags.h
diff --git a/patch/bar_fancybar.c b/patch/bar_fancybar.c
new file mode 100644
index 0000000..a193876
--- /dev/null
+++ b/patch/bar_fancybar.c
@@ -0,0 +1,89 @@
+int
+width_fancybar(Bar *bar, BarWidthArg *a)
+{
+ return a->max_width;
+}
+
+int
+draw_fancybar(Bar *bar, BarDrawArg *a)
+{
+ int ftw, mw, ew = 0, n = 0;
+ unsigned int i;
+ Client *c;
+ Monitor *m = bar->mon;
+
+ #if BAR_PANGO_PATCH
+ int boxs = drw->font->h / 9;
+ int boxw = drw->font->h / 6 + 2;
+ #else
+ int boxs = drw->fonts->h / 9;
+ int boxw = drw->fonts->h / 6 + 2;
+ #endif // BAR_PANGO_PATCH
+ #if BAR_TITLE_LEFT_PAD && BAR_TITLE_RIGHT_PAD
+ int x = a->x + lrpad / 2, w = a->w - lrpad;
+ #elif BAR_TITLE_LEFT_PAD
+ int x = a->x + lrpad / 2, w = a->w - lrpad / 2;
+ #elif BAR_TITLE_RIGHT_PAD
+ int x = a->x, w = a->w - lrpad / 2;
+ #else
+ int x = a->x, w = a->w;
+ #endif // BAR_TITLE_LEFT_PAD | BAR_TITLE_RIGHT_PAD
+
+ for (c = m->clients; c; c = c->next) {
+ if (ISVISIBLE(c))
+ n++;
+ }
+
+ if (n > 0) {
+ ftw = TEXTW(m->sel->name);
+ mw = (ftw >= w || n == 1) ? 0 : (w - ftw) / (n - 1);
+
+ i = 0;
+
+ for (c = m->clients; c; c = c->next) {
+ if (!ISVISIBLE(c) || c == m->sel)
+ continue;
+ ftw = TEXTW(c->name);
+ if (ftw < mw)
+ ew += (mw - ftw);
+ else
+ i++;
+ }
+
+ if (i > 0)
+ mw += ew / i;
+
+ for (c = m->clients; c; c = c->next) {
+ if (!ISVISIBLE(c))
+ continue;
+ ftw = MIN(m->sel == c ? w : mw, TEXTW(c->name));
+
+ #if BAR_VTCOLORS_PATCH
+ drw_setscheme(drw, scheme[m->sel == c ? SchemeTitleSel : SchemeTitleNorm]);
+ #elif BAR_TITLECOLOR_PATCH
+ drw_setscheme(drw, scheme[m->sel == c ? SchemeTitle : SchemeNorm]);
+ #else
+ drw_setscheme(drw, scheme[m->sel == c ? SchemeSel : SchemeNorm]);
+ #endif // BAR_VTCOLORS_PATCH / BAR_TITLECOLOR_PATCH
+ if (ftw > 0) /* trap special handling of 0 in drw_text */
+ #if BAR_PANGO_PATCH
+ drw_text(drw, x, 0, ftw, bh, lrpad / 2, c->name, 0, False);
+ #else
+ drw_text(drw, x, 0, ftw, bh, lrpad / 2, c->name, 0);
+ #endif // BAR_PANGO_PATCH
+ if (c->isfloating)
+ drw_rect(drw, x + boxs, boxs, boxw, boxw, c->isfixed, 0);
+ x += ftw;
+ w -= ftw;
+ }
+ }
+ return x + w;
+}
+
+int
+click_fancybar(Bar *bar, Arg *arg, BarClickArg *a)
+{
+ return ClkWinTitle;
+}
+
+
diff --git a/patch/bar_fancybar.h b/patch/bar_fancybar.h
new file mode 100644
index 0000000..c90d189
--- /dev/null
+++ b/patch/bar_fancybar.h
@@ -0,0 +1,3 @@
+static int width_fancybar(Bar *bar, BarWidthArg *a);
+static int draw_fancybar(Bar *bar, BarDrawArg *a);
+static int click_fancybar(Bar *bar, Arg *arg, BarClickArg *a); \ No newline at end of file
diff --git a/patch/bar_holdbar.c b/patch/bar_holdbar.c
new file mode 100644
index 0000000..358cbec
--- /dev/null
+++ b/patch/bar_holdbar.c
@@ -0,0 +1,37 @@
+void
+holdbar(const Arg *arg)
+{
+ if (selmon->showbar)
+ return;
+ Bar *bar;
+ selmon->showbar = 2;
+ updatebarpos(selmon);
+ for (bar = selmon->bar; bar; bar = bar->next)
+ XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
+}
+
+void
+keyrelease(XEvent *e)
+{
+ Bar *bar;
+ if (XEventsQueued(dpy, QueuedAfterReading)) {
+ XEvent ne;
+ XPeekEvent(dpy, &ne);
+
+ if (ne.type == KeyPress && ne.xkey.time == e->xkey.time &&
+ ne.xkey.keycode == e->xkey.keycode) {
+ XNextEvent(dpy, &ne);
+ return;
+ }
+ }
+ if (e->xkey.keycode == XKeysymToKeycode(dpy, HOLDKEY) && selmon->showbar == 2) {
+ selmon->showbar = 0;
+ updatebarpos(selmon);
+ for (bar = selmon->bar; bar; bar = bar->next)
+ XMoveResizeWindow(dpy, bar->win, bar->bx, bar->by, bar->bw, bar->bh);
+ arrange(selmon);
+ }
+ #if COMBO_PATCH
+ combo = 0;
+ #endif // COMBO_PATCH
+} \ No newline at end of file
diff --git a/patch/bar_holdbar.h b/patch/bar_holdbar.h
new file mode 100644
index 0000000..5394425
--- /dev/null
+++ b/patch/bar_holdbar.h
@@ -0,0 +1,2 @@
+static void keyrelease(XEvent *e);
+static void holdbar(const Arg *arg); \ No newline at end of file
diff --git a/patch/bar_ltsymbol.c b/patch/bar_ltsymbol.c
new file mode 100644
index 0000000..65ce2da
--- /dev/null
+++ b/patch/bar_ltsymbol.c
@@ -0,0 +1,21 @@
+int
+width_ltsymbol(Bar *bar, BarWidthArg *a)
+{
+ return TEXTW(bar->mon->ltsymbol);
+}
+
+int
+draw_ltsymbol(Bar *bar, BarDrawArg *a)
+{
+ #if BAR_PANGO_PATCH
+ return drw_text(drw, a->x, 0, a->w, bh, lrpad / 2, bar->mon->ltsymbol, 0, False);
+ #else
+ return drw_text(drw, a->x, 0, a->w, bh, lrpad / 2, bar->mon->ltsymbol, 0);
+ #endif // BAR_PANGO_PATCH
+}
+
+int
+click_ltsymbol(Bar *bar, Arg *arg, BarClickArg *a)
+{
+ return ClkLtSymbol;
+} \ No newline at end of file
diff --git a/patch/bar_ltsymbol.h b/patch/bar_ltsymbol.h
new file mode 100644
index 0000000..d9c79bf
--- /dev/null
+++ b/patch/bar_ltsymbol.h
@@ -0,0 +1,3 @@
+static int width_ltsymbol(Bar *bar, BarWidthArg *a);
+static int draw_ltsymbol(Bar *bar, BarDrawArg *a);
+static int click_ltsymbol(Bar *bar, Arg *arg, BarClickArg *a);
diff --git a/patch/bar_status.c b/patch/bar_status.c
new file mode 100644
index 0000000..0234276
--- /dev/null
+++ b/patch/bar_status.c
@@ -0,0 +1,49 @@
+int
+width_status(Bar *bar, BarWidthArg *a)
+{
+ #if BAR_PANGO_PATCH
+ return TEXTWM(stext);
+ #else
+ return TEXTW(stext);
+ #endif // BAR_PANGO_PATCH
+}
+
+#if BAR_EXTRASTATUS_PATCH
+int
+width_status_es(Bar *bar, BarWidthArg *a)
+{
+ #if BAR_PANGO_PATCH
+ return TEXTWM(estext) - lrpad;
+ #else
+ return TEXTW(estext) - lrpad;
+ #endif // BAR_PANGO_PATCH
+}
+#endif // BAR_EXTRASTATUS_PATCH
+
+int
+draw_status(Bar *bar, BarDrawArg *a)
+{
+ #if BAR_PANGO_PATCH
+ return drw_text(drw, a->x, 0, a->w, bh, lrpad / 2, stext, 0, True);
+ #else
+ return drw_text(drw, a->x, 0, a->w, bh, lrpad / 2, stext, 0);
+ #endif // BAR_PANGO_PATCH
+}
+
+#if BAR_EXTRASTATUS_PATCH
+int
+draw_status_es(Bar *bar, BarDrawArg *a)
+{
+ #if BAR_PANGO_PATCH
+ return drw_text(drw, a->x, 0, a->w, bh, 0, estext, 0, True);
+ #else
+ return drw_text(drw, a->x, 0, a->w, bh, 0, estext, 0);
+ #endif // BAR_PANGO_PATCH
+}
+#endif // BAR_EXTRASTATUS_PATCH
+
+int
+click_status(Bar *bar, Arg *arg, BarClickArg *a)
+{
+ return ClkStatusText;
+}
diff --git a/patch/bar_status.h b/patch/bar_status.h
new file mode 100644
index 0000000..36fabbb
--- /dev/null
+++ b/patch/bar_status.h
@@ -0,0 +1,9 @@
+static int width_status(Bar *bar, BarWidthArg *a);
+#if BAR_EXTRASTATUS_PATCH
+static int width_status_es(Bar *bar, BarWidthArg *a);
+#endif // BAR_EXTRASTATUS_PATCH
+static int draw_status(Bar *bar, BarDrawArg *a);
+#if BAR_EXTRASTATUS_PATCH
+static int draw_status_es(Bar *bar, BarDrawArg *a);
+#endif // BAR_EXTRASTATUS_PATCH
+static int click_status(Bar *bar, Arg *arg, BarClickArg *a); \ No newline at end of file
diff --git a/patch/status2d.c b/patch/bar_status2d.c
index 99dcacd..e746ac6 100644
--- a/patch/status2d.c
+++ b/patch/bar_status2d.c
@@ -1,7 +1,43 @@
int
-drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp, int align)
+width_status2d(Bar *bar, BarWidthArg *a)
{
- int ret, i, w, x, len;
+ return status2dtextlength(rawstext) + lrpad;
+}
+
+#if BAR_EXTRASTATUS_PATCH
+int
+width_status2d_es(Bar *bar, BarWidthArg *a)
+{
+ return status2dtextlength(rawestext);
+}
+#endif // BAR_EXTRASTATUS_PATCH
+
+int
+draw_status2d(Bar *bar, BarDrawArg *a)
+{
+ return drawstatusbar(a->x, rawstext);
+}
+
+#if BAR_EXTRASTATUS_PATCH
+int
+draw_status2d_es(Bar *bar, BarDrawArg *a)
+{
+ return drawstatusbar(a->x, rawestext);
+}
+#endif // BAR_EXTRASTATUS_PATCH
+
+#if !BAR_STATUSCMD_PATCH
+int
+click_status2d(Bar *bar, Arg *arg, BarClickArg *a)
+{
+ return ClkStatusText;
+}
+#endif // BAR_STATUSCMD_PATCH
+
+int
+drawstatusbar(int x, char* stext)
+{
+ int i, w, len;
short isCode = 0;
char *text;
char *p;
@@ -10,58 +46,13 @@ drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp, int align)
if (!(text = (char*) malloc(sizeof(char)*len)))
die("malloc");
p = text;
- #if STATUSCMD_PATCH
+ #if BAR_STATUSCMD_PATCH
copyvalidchars(text, stext);
#else
memcpy(text, stext, len);
- #endif // STATUSCMD_PATCH
+ #endif // BAR_STATUSCMD_PATCH
- /* compute width of the status text */
- w = stp * 2;
- i = -1;
- while (text[++i]) {
- if (text[i] == '^') {
- if (!isCode) {
- isCode = 1;
- text[i] = '\0';
- #if PANGO_PATCH
- w += TEXTWM(text) - lrpad;
- #else
- w += TEXTW(text) - lrpad;
- #endif // PANGO_PATCH
- text[i] = '^';
- if (text[++i] == 'f')
- w += atoi(text + ++i);
- } else {
- isCode = 0;
- text = text + i + 1;
- i = -1;
- }
- }
- }
- if (!isCode)
- #if PANGO_PATCH
- w += TEXTWM(text) - lrpad;
- #else
- w += TEXTW(text) - lrpad;
- #endif // PANGO_PATCH
- else
- isCode = 0;
- text = p;
- w += 2; /* 1px padding on both sides */
- if (align == 0)
- x = 0 + stp; // left
- else if (align == 1)
- x = m->ww - w - stw + stp; // right
- else
- x = m->ww / 2 - w / 2; // center
- ret = w;
-
- drw_setscheme(drw, scheme[LENGTH(colors)]);
- drw->scheme[ColFg] = scheme[SchemeNorm][ColFg];
- drw->scheme[ColBg] = scheme[SchemeNorm][ColBg];
- drw_rect(drw, x - stp - 1, 0, w, bh, 1, 1);
- x++;
+ x += lrpad / 2;
/* process status text */
i = -1;
@@ -70,13 +61,13 @@ drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp, int align)
isCode = 1;
text[i] = '\0';
- #if PANGO_PATCH
+ #if BAR_PANGO_PATCH
w = TEXTWM(text) - lrpad;
drw_text(drw, x, 0, w, bh, 0, text, 0, True);
#else
w = TEXTW(text) - lrpad;
drw_text(drw, x, 0, w, bh, 0, text, 0);
- #endif // PANGO_PATCH
+ #endif // BAR_PANGO_PATCH
x += w;
@@ -90,13 +81,13 @@ drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp, int align)
}
memcpy(buf, (char*)text+i+1, 7);
buf[7] = '\0';
- #if ALPHA_PATCH && STATUS2D_NO_ALPHA_PATCH
+ #if BAR_ALPHA_PATCH && BAR_STATUS2D_NO_ALPHA_PATCH
drw_clr_create(drw, &drw->scheme[ColFg], buf, 0xff);
- #elif ALPHA_PATCH
+ #elif BAR_ALPHA_PATCH
drw_clr_create(drw, &drw->scheme[ColFg], buf, alphas[SchemeNorm][ColFg]);
#else
drw_clr_create(drw, &drw->scheme[ColFg], buf);
- #endif // ALPHA_PATCH
+ #endif // BAR_ALPHA_PATCH
i += 7;
} else if (text[i] == 'b') {
char buf[8];
@@ -106,13 +97,13 @@ drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp, int align)
}
memcpy(buf, (char*)text+i+1, 7);
buf[7] = '\0';
- #if ALPHA_PATCH && STATUS2D_NO_ALPHA_PATCH
+ #if BAR_ALPHA_PATCH && BAR_STATUS2D_NO_ALPHA_PATCH
drw_clr_create(drw, &drw->scheme[ColBg], buf, 0xff);
- #elif ALPHA_PATCH
+ #elif BAR_ALPHA_PATCH
drw_clr_create(drw, &drw->scheme[ColBg], buf, alphas[SchemeNorm][ColBg]);
#else
drw_clr_create(drw, &drw->scheme[ColBg], buf);
- #endif // ALPHA_PATCH
+ #endif // BAR_ALPHA_PATCH
i += 7;
} else if (text[i] == 'd') {
drw->scheme[ColFg] = scheme[SchemeNorm][ColFg];
@@ -142,21 +133,21 @@ drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp, int align)
isCode = 0;
}
}
-
if (!isCode) {
- #if PANGO_PATCH
+ #if BAR_PANGO_PATCH
w = TEXTWM(text) - lrpad;
drw_text(drw, x, 0, w, bh, 0, text, 0, True);
#else
w = TEXTW(text) - lrpad;
drw_text(drw, x, 0, w, bh, 0, text, 0);
- #endif // PANGO_PATCH
+ #endif // BAR_PANGO_PATCH
+ x += w;
}
+ free(p);
drw_setscheme(drw, scheme[SchemeNorm]);
- free(p);
- return ret;
+ return x;
}
int
@@ -165,16 +156,17 @@ status2dtextlength(char* stext)
int i, w, len;
short isCode = 0;
char *text;
+ char *p;
len = strlen(stext) + 1;
if (!(text = (char*) malloc(sizeof(char)*len)))
die("malloc");
-
- #if STATUSCMD_PATCH
+ p = text;
+ #if BAR_STATUSCMD_PATCH
copyvalidchars(text, stext);
#else
memcpy(text, stext, len);
- #endif // STATUSCMD_PATCH
+ #endif // BAR_STATUSCMD_PATCH
/* compute width of the status text */
w = 0;
@@ -184,11 +176,11 @@ status2dtextlength(char* stext)
if (!isCode) {
isCode = 1;
text[i] = '\0';
- #if PANGO_PATCH
+ #if BAR_PANGO_PATCH
w += TEXTWM(text) - lrpad;
#else
w += TEXTW(text) - lrpad;
- #endif // PANGO_PATCH
+ #endif // BAR_PANGO_PATCH
text[i] = '^';
if (text[++i] == 'f')
w += atoi(text + ++i);
@@ -200,10 +192,11 @@ status2dtextlength(char* stext)
}
}
if (!isCode)
- #if PANGO_PATCH
+ #if BAR_PANGO_PATCH
w += TEXTWM(text) - lrpad;
#else
w += TEXTW(text) - lrpad;
- #endif // PANGO_PATCH
+ #endif // BAR_PANGO_PATCH
+ free(p);
return w;
-}
+} \ No newline at end of file
diff --git a/patch/bar_status2d.h b/patch/bar_status2d.h
new file mode 100644
index 0000000..cdaa2a8
--- /dev/null
+++ b/patch/bar_status2d.h
@@ -0,0 +1,13 @@
+static int width_status2d(Bar *bar, BarWidthArg *a);
+#if BAR_EXTRASTATUS_PATCH
+static int width_status2d_es(Bar *bar, BarWidthArg *a);
+#endif // BAR_EXTRASTATUS_PATCH
+static int draw_status2d(Bar *bar, BarDrawArg *a);
+#if BAR_EXTRASTATUS_PATCH
+static int draw_status2d_es(Bar *bar, BarDrawArg *a);
+#endif // BAR_EXTRASTATUS_PATCH
+#if !BAR_STATUSCMD_PATCH
+static int click_status2d(Bar *bar, Arg *arg, BarClickArg *a);
+#endif // BAR_STATUSCMD_PATCH
+static int drawstatusbar(int x, char* text);
+static int status2dtextlength(char* stext); \ No newline at end of file
diff --git a/patch/bar_status2d_eb.h b/patch/bar_status2d_eb.h
new file mode 100644
index 0000000..a20f8d5
--- /dev/null
+++ b/patch/bar_status2d_eb.h
@@ -0,0 +1,2 @@
+static int width_status2d_eb(Bar *bar, BarWidthArg *a);
+static int draw_status2d_eb(Bar *bar, BarDrawArg *a); \ No newline at end of file
diff --git a/patch/bar_statusbutton.c b/patch/bar_statusbutton.c
new file mode 100644
index 0000000..f5c9c9d
--- /dev/null
+++ b/patch/bar_statusbutton.c
@@ -0,0 +1,21 @@
+int
+width_stbutton(Bar *bar, BarWidthArg *a)
+{
+ return TEXTW(buttonbar);
+}
+
+int
+draw_stbutton(Bar *bar, BarDrawArg *a)
+{
+ #if BAR_PANGO_PATCH
+ return drw_text(drw, a->x, 0, a->w, bh, lrpad / 2, buttonbar, 0, False);
+ #else
+ return drw_text(drw, a->x, 0, a->w, bh, lrpad / 2, buttonbar, 0);
+ #endif // BAR_PANGO_PATCH
+}
+
+int
+click_stbutton(Bar *bar, Arg *arg, BarClickArg *a)
+{
+ return ClkButton;
+}
diff --git a/patch/bar_statusbutton.h b/patch/bar_statusbutton.h
new file mode 100644
index 0000000..8e9d6fe
--- /dev/null
+++ b/patch/bar_statusbutton.h
@@ -0,0 +1,3 @@
+static int width_stbutton(Bar *bar, BarWidthArg *a);
+static int draw_stbutton(Bar *bar, BarDrawArg *a);
+static int click_stbutton(Bar *bar, Arg *arg, BarClickArg *a); \ No newline at end of file
diff --git a/patch/bar_statuscmd.c b/patch/bar_statuscmd.c
new file mode 100644
index 0000000..0cd6013
--- /dev/null
+++ b/patch/bar_statuscmd.c
@@ -0,0 +1,76 @@
+#if !BAR_DWMBLOCKS_PATCH
+static const char statusexport[] = "export BUTTON=-;";
+static int statuscmdn;
+static int lastbutton;
+#endif // BAR_DWMBLOCKS_PATCH
+
+int
+click_statuscmd(Bar *bar, Arg *arg, BarClickArg *a)
+{
+ return click_statuscmd_text(arg, a->rel_x, rawstext);
+}
+
+#if BAR_EXTRASTATUS_PATCH
+int
+click_statuscmd_es(Bar *bar, Arg *arg, BarClickArg *a)
+{
+ return click_statuscmd_text(arg, a->rel_x, rawestext);
+}
+#endif // BAR_EXTRASTATUS_PATCH
+
+int
+click_statuscmd_text(Arg *arg, int rel_x, char *text)
+{
+ int i = -1;
+ int x = 0;
+ char ch;
+ #if BAR_DWMBLOCKS_PATCH
+ dwmblockssig = -1;
+ #else
+ statuscmdn = 0;
+ #endif // BAR_DWMBLOCKS_PATCH
+ while (text[++i]) {
+ if ((unsigned char)text[i] < ' ') {
+ ch = text[i];
+ text[i] = '\0';
+ #if BAR_STATUS2D_PATCH && !BAR_BAR_STATUSCOLORS_PATCH
+ x += status2dtextlength(text);
+ #elif BAR_PANGO_PATCH
+ x += TEXTWM(text) - lrpad;
+ #else
+ x += TEXTW(text) - lrpad;
+ #endif // STATUS2D_PATCH
+ text[i] = ch;
+ text += i+1;
+ i = -1;
+ #if BAR_DWMBLOCKS_PATCH
+ if (x >= rel_x && dwmblockssig != -1)
+ break;
+ dwmblockssig = ch;
+ #else
+ if (x >= rel_x)
+ break;
+ if (ch <= LENGTH(statuscmds))
+ statuscmdn = ch - 1;
+ #endif // BAR_DWMBLOCKS_PATCH
+ }
+ }
+ #if BAR_DWMBLOCKS_PATCH
+ if (dwmblockssig == -1)
+ dwmblockssig = 0;
+ #endif // BAR_DWMBLOCKS_PATCH
+ return ClkStatusText;
+}
+
+void
+copyvalidchars(char *text, char *rawtext)
+{
+ int i = -1, j = 0;
+
+ while (rawtext[++i]) {
+ if ((unsigned char)rawtext[i] >= ' ') {
+ text[j++] = rawtext[i];
+ }
+ }
+ text[j] = '\0';
+}
diff --git a/patch/bar_statuscmd.h b/patch/bar_statuscmd.h
new file mode 100644
index 0000000..0e1e184
--- /dev/null
+++ b/patch/bar_statuscmd.h
@@ -0,0 +1,6 @@
+static int click_statuscmd(Bar *bar, Arg *arg, BarClickArg *a);
+#if BAR_EXTRASTATUS_PATCH
+static int click_statuscmd_es(Bar *bar, Arg *arg, BarClickArg *a);
+#endif // BAR_EXTRASTATUS_PATCH
+static int click_statuscmd_text(Arg *arg, int rel_x, char *text);
+static void copyvalidchars(char *text, char *rawtext); \ No newline at end of file
diff --git a/patch/statuscolors.c b/patch/bar_statuscolors.c
index ef41735..cc24ad4 100644
--- a/patch/statuscolors.c
+++ b/patch/bar_statuscolors.c
@@ -12,11 +12,11 @@ textw_wosc(char *s)
}
ctmp = *ts;
*ts = '\0';
- #if PANGO_PATCH
+ #if BAR_PANGO_PATCH
sw += drw_font_getwidth(drw, tp, True);
#else
sw += drw_fontset_getwidth(drw, tp);
- #endif // PANGO_PATCH
+ #endif // BAR_PANGO_PATCH
*ts = ctmp;
if (ctmp == '\0')
break;
diff --git a/patch/systray.c b/patch/bar_systray.c
index 0ca2f86..0ff730d 100644
--- a/patch/systray.c
+++ b/patch/bar_systray.c
@@ -1,75 +1,28 @@
-
static Systray *systray = NULL;
static unsigned long systrayorientation = _NET_SYSTEM_TRAY_ORIENTATION_HORZ;
-unsigned int
-getsystraywidth()
+int
+width_systray(Bar *bar, BarWidthArg *a)
{
unsigned int w = 0;
Client *i;
+ if (!systray)
+ return 1;
if (showsystray)
for (i = systray->icons; i; w += i->w + systrayspacing, i = i->next);
- return w ? w + systrayspacing : 0;
-}
-
-void
-removesystrayicon(Client *i)
-{
- Client **ii;
-
- if (!showsystray || !i)
- return;
- for (ii = &systray->icons; *ii && *ii != i; ii = &(*ii)->next);
- if (ii)
- *ii = i->next;
- free(i);
-}
-
-void
-resizerequest(XEvent *e)
-{
- XResizeRequestEvent *ev = &e->xresizerequest;
- Client *i;
-
- if ((i = wintosystrayicon(ev->window))) {
- updatesystrayicongeom(i, ev->width, ev->height);
- updatesystray();
- }
+ return w ? w + lrpad - systrayspacing : 0;
}
-Monitor *
-systraytomon(Monitor *m)
+int
+draw_systray(Bar *bar, BarDrawArg *a)
{
- Monitor *t;
- int i, n;
- if (!systraypinning) {
- if (!m)
- return selmon;
- return m == selmon ? m : NULL;
- }
- for (n = 1, t = mons; t && t->next; n++, t = t->next);
- for (i = 1, t = mons; t && t->next && i < systraypinning; i++, t = t->next);
- if (systraypinningfailfirst && n < systraypinning)
- return mons;
- return t;
-}
+ if (!showsystray)
+ return a->x;
-void
-updatesystray(void)
-{
XSetWindowAttributes wa;
- XWindowChanges wc;
Client *i;
- Monitor *m = systraytomon(NULL);
- unsigned int x = m->mx + m->mw;
- unsigned int w = 1, xpad = 0, ypad = 0;
- #if BARPADDING_PATCH
- xpad = sp;
- ypad = vp;
- #endif // BARPADDING_PATCH
+ unsigned int w;
- if (!showsystray)
- return;
if (!systray) {
/* init systray */
if (!(systray = (Systray *)calloc(1, sizeof(Systray))))
@@ -77,24 +30,26 @@ updatesystray(void)
wa.override_redirect = True;
wa.event_mask = ButtonPressMask|ExposureMask;
- wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
wa.border_pixel = 0;
- #if ALPHA_PATCH
+ #if BAR_ALPHA_PATCH
+ wa.background_pixel = 0;
wa.colormap = cmap;
- systray->win = XCreateWindow(dpy, root, x - xpad, m->by + ypad, w, bh, 0, depth,
+ systray->win = XCreateWindow(dpy, root, bar->bx + a->x + lrpad / 2, bar->by, MAX(a->w + 40, 1), bar->bh, 0, depth,
InputOutput, visual,
- CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &wa);
+ CWOverrideRedirect|CWBorderPixel|CWBackPixel|CWColormap|CWEventMask, &wa); // CWBackPixmap
#else
- systray->win = XCreateSimpleWindow(dpy, root, x - xpad, m->by + ypad, w, bh, 0, 0, scheme[SchemeNorm][ColBg].pixel);
+ wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
+ systray->win = XCreateSimpleWindow(dpy, root, bar->bx + a->x + lrpad / 2, bar->by, MIN(a->w, 1), bar->bh, 0, 0, scheme[SchemeNorm][ColBg].pixel);
XChangeWindowAttributes(dpy, systray->win, CWOverrideRedirect|CWBackPixel|CWBorderPixel|CWEventMask, &wa);
- #endif // ALPHA_PATCH
+ #endif // BAR_ALPHA_PATCH
+
XSelectInput(dpy, systray->win, SubstructureNotifyMask);
XChangeProperty(dpy, systray->win, netatom[NetSystemTrayOrientation], XA_CARDINAL, 32,
PropModeReplace, (unsigned char *)&systrayorientation, 1);
- #if ALPHA_PATCH
+ #if BAR_ALPHA_PATCH
XChangeProperty(dpy, systray->win, netatom[NetSystemTrayVisual], XA_VISUALID, 32,
PropModeReplace, (unsigned char *)&visual->visualid, 1);
- #endif // ALPHA_PATCH
+ #endif // BAR_ALPHA_PATCH
XChangeProperty(dpy, systray->win, netatom[NetWMWindowType], XA_ATOM, 32,
PropModeReplace, (unsigned char *)&netatom[NetWMWindowTypeDock], 1);
XMapRaised(dpy, systray->win);
@@ -102,43 +57,68 @@ updatesystray(void)
if (XGetSelectionOwner(dpy, netatom[NetSystemTray]) == systray->win) {
sendevent(root, xatom[Manager], StructureNotifyMask, CurrentTime, netatom[NetSystemTray], systray->win, 0, 0);
XSync(dpy, False);
- }
- else {
+ } else {
fprintf(stderr, "dwm: unable to obtain system tray.\n");
free(systray);
systray = NULL;
- return;
+ return a->x;
}
}
+ systray->bar = bar;
+
drw_setscheme(drw, scheme[SchemeNorm]);
for (w = 0, i = systray->icons; i; i = i->next) {
- /* make sure the background color stays the same */
+ #if BAR_ALPHA_PATCH
+ wa.background_pixel = 0;
+ #else
wa.background_pixel = scheme[SchemeNorm][ColBg].pixel;
+ #endif // BAR_ALPHA_PATCH
XChangeWindowAttributes(dpy, i->win, CWBackPixel, &wa);
XMapRaised(dpy, i->win);
- w += systrayspacing;
i->x = w;
XMoveResizeWindow(dpy, i->win, i->x, 0, i->w, i->h);
w += i->w;
- if (i->mon != m)
- i->mon = m;
+ if (i->next)
+ w += systrayspacing;
+ if (i->mon != bar->mon)
+ i->mon = bar->mon;
+ }
+
+ XMoveResizeWindow(dpy, systray->win, bar->bx + a->x + lrpad / 2, (w ? bar->by : -bar->by), MAX(w, 1), bar->bh);
+ return a->x + a->w;
+}
+
+int
+click_systray(Bar *bar, Arg *arg, BarClickArg *a)
+{
+ return -1;
+}
+
+void
+removesystrayicon(Client *i)
+{
+ Client **ii;
+
+ if (!showsystray || !i)
+ return;
+ for (ii = &systray->icons; *ii && *ii != i; ii = &(*ii)->next);
+ if (ii)
+ *ii = i->next;
+ free(i);
+ drawbarwin(systray->bar);
+}
+
+void
+resizerequest(XEvent *e)
+{
+ XResizeRequestEvent *ev = &e->xresizerequest;
+ Client *i;
+
+ if ((i = wintosystrayicon(ev->window))) {
+ updatesystrayicongeom(i, ev->width, ev->height);
+ drawbarwin(systray->bar);
}
- w = w ? w + systrayspacing : 1;
- x -= w;
- XMoveResizeWindow(dpy, systray->win, x - xpad, m->by + ypad, w, bh);
- wc.x = x - xpad;
- wc.y = m->by + ypad;
- wc.width = w;
- wc.height = bh;
- wc.stack_mode = Above; wc.sibling = m->barwin;
- XConfigureWindow(dpy, systray->win, CWX|CWY|CWWidth|CWHeight|CWSibling|CWStackMode, &wc);
- XMapWindow(dpy, systray->win);
- XMapSubwindows(dpy, systray->win);
- /* redraw background */
- XSetForeground(dpy, drw->gc, scheme[SchemeNorm][ColBg].pixel);
- XFillRectangle(dpy, systray->win, drw->gc, 0, 0, w, bh);
- XSync(dpy, False);
}
void
@@ -197,8 +177,9 @@ updatesystrayiconstate(Client *i, XPropertyEvent *ev)
Client *
wintosystrayicon(Window w)
{
+ if (!systray)
+ return NULL;
Client *i = NULL;
-
if (!showsystray || !w)
return i;
for (i = systray->icons; i && i->win != w; i = i->next);
diff --git a/patch/systray.h b/patch/bar_systray.h
index 1a2bab6..5123a73 100644
--- a/patch/systray.h
+++ b/patch/bar_systray.h
@@ -22,15 +22,18 @@ typedef struct Systray Systray;
struct Systray {
Window win;
Client *icons;
+ Bar *bar;
};
+/* bar integration */
+static int width_systray(Bar *bar, BarWidthArg *a);
+static int draw_systray(Bar *bar, BarDrawArg *a);
+static int click_systray(Bar *bar, Arg *arg, BarClickArg *a);
+
/* function declarations */
static Atom getatomprop(Client *c, Atom prop);
-static unsigned int getsystraywidth();
static void removesystrayicon(Client *i);
static void resizerequest(XEvent *e);
-static Monitor *systraytomon(Monitor *m);
-static void updatesystray(void);
static void updatesystrayicongeom(Client *i, int w, int h);
static void updatesystrayiconstate(Client *i, XPropertyEvent *ev);
static Client *wintosystrayicon(Window w);
diff --git a/patch/bar_taggrid.c b/patch/bar_taggrid.c
new file mode 100644
index 0000000..dd439f7
--- /dev/null
+++ b/patch/bar_taggrid.c
@@ -0,0 +1,166 @@
+int
+width_taggrid(Bar *bar, BarWidthArg *a)
+{
+ return (bh / 2) * (LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0)) + lrpad;
+}
+
+int
+draw_taggrid(Bar *bar, BarDrawArg *a)
+{
+ unsigned int x, y, h, max_x = 0, columns, occ = 0;
+ int invert, i,j, k;
+ Client *c;
+
+ for (c = bar->mon->clients; c; c = c->next)
+ occ |= c->tags;
+
+ max_x = x = a->x + lrpad / 2;
+ h = bh / tagrows;
+ y = 0;
+ columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0);
+
+ /* Firstly we will fill the borders of squares */
+ #if BAR_VTCOLORS_PATCH
+ XSetForeground(drw->dpy, drw->gc, scheme[SchemeTagsNorm][ColBg].pixel);
+ #else
+ XSetForeground(drw->dpy, drw->gc, scheme[SchemeNorm][ColBg].pixel);
+ #endif // BAR_VTCOLORS_PATCH
+ XFillRectangle(dpy, drw->drawable, drw->gc, x, y, h*columns + 1, bh);
+
+ /* We will draw LENGTH(tags) squares in tagraws raws. */
+ for (j = 0, i = 0; j < tagrows; j++) {
+ x = a->x + lrpad / 2;
+ for (k = 0; k < columns; k++, i++) {
+ if (i < LENGTH(tags)) {
+ invert = bar->mon->tagset[bar->mon->seltags] & 1 << i ? 0 : 1;
+
+ /* Select active color for current square */
+ #if BAR_VTCOLORS_PATCH
+ XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeTagsSel][ColBg].pixel :
+ scheme[SchemeTagsNorm][ColFg].pixel);
+ #else
+ XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeSel][ColBg].pixel :
+ scheme[SchemeNorm][ColFg].pixel);
+ #endif // BAR_VTCOLORS_PATCH
+ XFillRectangle(dpy, drw->drawable, drw->gc, x+1, y+1, h-1, h-1);
+
+ /* Mark square if tag has client */
+ if (occ & 1 << i) {
+ #if BAR_VTCOLORS_PATCH
+ XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeTagsSel][ColFg].pixel :
+ scheme[SchemeTagsNorm][ColBg].pixel);
+ #else
+ XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeSel][ColFg].pixel :
+ scheme[SchemeNorm][ColBg].pixel);
+ #endif // BAR_VTCOLORS_PATCH
+ XFillRectangle(dpy, drw->drawable, drw->gc, x + 1, y + 1,
+ h / 2, h / 2);
+ }
+ } else {
+ #if BAR_VTCOLORS_PATCH
+ XSetForeground(drw->dpy, drw->gc, scheme[SchemeTagsNorm][ColBg].pixel);
+ #else
+ XSetForeground(drw->dpy, drw->gc, scheme[SchemeNorm][ColBg].pixel);
+ #endif // BAR_VTCOLORS_PATCH
+ XFillRectangle(dpy, drw->drawable, drw->gc, x+1, y+1, h-1, h);
+ }
+ x += h;
+ if (x > max_x) {
+ max_x = x;
+ }
+ }
+ y += h;
+ }
+ return max_x;
+}
+
+int
+click_taggrid(Bar *bar, Arg *arg, BarClickArg *a)
+{
+ unsigned int i, columns;
+
+ columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0);
+ i = (a->rel_x - lrpad / 2) / (bh / tagrows) + columns * (a->rel_y / (bh / tagrows));
+ if (i >= LENGTH(tags)) {
+ i = LENGTH(tags) - 1;
+ }
+ arg->ui = 1 << i;
+ return ClkTagBar;
+}
+
+void
+switchtag(const Arg *arg)
+{
+ unsigned int columns;
+ unsigned int new_tagset = 0;
+ unsigned int pos, i;
+ int col, row;
+ Arg new_arg;
+
+ columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0);
+
+ for (i = 0; i < LENGTH(tags); ++i) {
+ if (!(selmon->tagset[selmon->seltags] & 1 << i)) {
+ continue;
+ }
+ pos = i;
+ row = pos / columns;
+ col = pos % columns;
+ if (arg->ui & SWITCHTAG_UP) { /* UP */
+ row --;
+ if (row < 0) {
+ row = tagrows - 1;
+ }
+ do {
+ pos = row * columns + col;
+ row --;
+ } while (pos >= LENGTH(tags));
+ }
+ if (arg->ui & SWITCHTAG_DOWN) { /* DOWN */
+ row ++;
+ if (row >= tagrows) {
+ row = 0;
+ }
+ pos = row * columns + col;
+ if (pos >= LENGTH(tags)) {
+ row = 0;
+ }
+ pos = row * columns + col;
+ }
+ if (arg->ui & SWITCHTAG_LEFT) { /* LEFT */
+ col --;
+ if (col < 0) {
+ col = columns - 1;
+ }
+ do {
+ pos = row * columns + col;
+ col --;
+ } while (pos >= LENGTH(tags));
+ }
+ if (arg->ui & SWITCHTAG_RIGHT) { /* RIGHT */
+ col ++;
+ if (col >= columns) {
+ col = 0;
+ }
+ pos = row * columns + col;
+ if (pos >= LENGTH(tags)) {
+ col = 0;
+ pos = row * columns + col;
+ }
+ }
+ new_tagset |= 1 << pos;
+ }
+ new_arg.ui = new_tagset;
+ if (arg->ui & SWITCHTAG_TOGGLETAG) {
+ toggletag(&new_arg);
+ }
+ if (arg->ui & SWITCHTAG_TAG) {
+ tag(&new_arg);
+ }
+ if (arg->ui & SWITCHTAG_VIEW) {
+ view (&new_arg);
+ }
+ if (arg->ui & SWITCHTAG_TOGGLEVIEW) {
+ toggleview (&new_arg);
+ }
+} \ No newline at end of file
diff --git a/patch/bar_taggrid.h b/patch/bar_taggrid.h
new file mode 100644
index 0000000..c35b337
--- /dev/null
+++ b/patch/bar_taggrid.h
@@ -0,0 +1,4 @@
+static int width_taggrid(Bar *bar, BarWidthArg *a);
+static int draw_taggrid(Bar *bar, BarDrawArg *a);
+static int click_taggrid(Bar *bar, Arg *arg, BarClickArg *a);
+static void switchtag(const Arg *arg); \ No newline at end of file
diff --git a/patch/bar_tags.c b/patch/bar_tags.c
new file mode 100644
index 0000000..1296853
--- /dev/null
+++ b/patch/bar_tags.c
@@ -0,0 +1,125 @@
+int
+width_tags(Bar *bar, BarWidthArg *a)
+{
+ int w, i;
+ for (w = 0, i = 0; i < LENGTH(tags); i++) {
+ #if BAR_ALTERNATIVE_TAGS_PATCH
+ w += selmon->alttag ? TEXTW(tagsalt[i]) : TEXTW(tags[i]);
+ #else
+ w += TEXTW(tags[i]);
+ #endif // BAR_ALTERNATIVE_TAGS_PATCH
+ }
+ return w + lrpad;
+}
+
+int
+draw_tags(Bar *bar, BarDrawArg *a)
+{
+ int invert;
+ int w, x = a->x + lrpad / 2;
+ #if BAR_ALTERNATIVE_TAGS_PATCH
+ int wdelta;
+ #endif // BAR_ALTERNATIVE_TAGS_PATCH
+ #if !BAR_HIDEVACANTTAGS_PATCH
+ #if !BAR_ACTIVETAGINDICATORBAR_PATCH && !BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH
+ #if BAR_PANGO_PATCH
+ int boxs = drw->font->h / 9;
+ #else
+ int boxs = drw->fonts->h / 9;
+ #endif // BAR_PANGO_PATCH
+ #endif // BAR_ACTIVETAGINDICATORBAR_PATCH | BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH
+ #if BAR_PANGO_PATCH
+ int boxw = drw->font->h / 6 + 2;
+ #else
+ int boxw = drw->fonts->h / 6 + 2;
+ #endif // BAR_PANGO_PATCH
+ #endif // BAR_HIDEVACANTTAGS_PATCH
+ unsigned int i, occ = 0, urg = 0;
+ Client *c;
+ Monitor *m = bar->mon;
+
+ for (c = m->clients; c; c = c->next) {
+ #if BAR_HIDEVACANTTAGS_PATCH
+ occ |= c->tags == 255 ? 0 : c->tags;
+ #else
+ occ |= c->tags;
+ #endif // BAR_HIDEVACANTTAGS_PATCH
+ if (c->isurgent)
+ urg |= c->tags;
+ }
+
+ for (i = 0; i < LENGTH(tags); i++) {
+ #if URGENTBORDER_PATCH
+ invert = 0;
+ #else
+ invert = urg & 1 << i;
+ #endif // URGENTBORDER_PATCH
+ #if BAR_HIDEVACANTTAGS_PATCH
+ /* do not draw vacant tags */
+ if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
+ continue;
+ #endif // BAR_HIDEVACANTTAGS_PATCH
+ w = TEXTW(tags[i]);
+ #if BAR_ALTERNATIVE_TAGS_PATCH
+ wdelta = selmon->alttag ? abs(TEXTW(tags[i]) - TEXTW(tagsalt[i])) / 2 : 0;
+ #endif // BAR_ALTERNATIVE_TAGS_PATCH
+ #if URGENTBORDER_PATCH
+ if (m->tagset[m->seltags] & 1 << i)
+ #if BAR_VTCOLORS_PATCH
+ drw_setscheme(drw, scheme[SchemeTagsSel]);
+ #else
+ drw_setscheme(drw, scheme[SchemeSel]);
+ #endif // BAR_VTCOLORS_PATCH
+ else
+ #if BAR_VTCOLORS_PATCH
+ drw_setscheme(drw, scheme[urg & 1 << i ? SchemeUrg : SchemeTagsNorm]);
+ #else
+ drw_setscheme(drw, scheme[urg & 1 << i ? SchemeUrg : SchemeNorm]);
+ #endif // BAR_VTCOLORS_PATCH
+ #elif BAR_VTCOLORS_PATCH
+ drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeTagsSel : SchemeTagsNorm]);
+ #else // URGENTBORDER_PATCH
+ drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
+ #endif // URGENTBORDER_PATCH
+ #if BAR_ALTERNATIVE_TAGS_PATCH && BAR_PANGO_PATCH
+ drw_text(drw, x, 0, w, bh, wdelta + lrpad / 2, (selmon->alttag ? tagsalt[i] : tags[i]), invert, False);
+ #elif BAR_ALTERNATIVE_TAGS_PATCH
+ drw_text(drw, x, 0, w, bh, wdelta + lrpad / 2, (selmon->alttag ? tagsalt[i] : tags[i]), invert);
+ #elif BAR_PANGO_PATCH
+ drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], invert, False);
+ #else
+ drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], invert);
+ #endif // BAR_ALTERNATIVE_TAGS_PATCH
+ #if !BAR_HIDEVACANTTAGS_PATCH
+ if (occ & 1 << i)
+ #if BAR_ACTIVETAGINDICATORBAR_PATCH
+ drw_rect(drw, x + boxw, 0, w - ( 2 * boxw + 1), boxw,
+ #elif BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH
+ drw_rect(drw, x + boxw, bh - boxw/2, w - ( 2 * boxw + 1), boxw/2,
+ #else
+ drw_rect(drw, x + boxs, boxs, boxw, boxw,
+ #endif // BAR_ACTIVETAGINDICATORBAR_PATCH
+ m == selmon && selmon->sel && selmon->sel->tags & 1 << i, invert);
+ #endif // BAR_HIDEVACANTTAGS_PATCH
+ x += w;
+ }
+
+ return x;
+}
+
+int
+click_tags(Bar *bar, Arg *arg, BarClickArg *a)
+{
+ int i = 0, x = lrpad / 2;
+ do
+ #if BAR_ALTERNATIVE_TAGS_PATCH
+ x += selmon->alttag ? TEXTW(tagsalt[i]) : TEXTW(tags[i]);
+ #else
+ x += TEXTW(tags[i]);
+ #endif
+ while (a->rel_x >= x && ++i < LENGTH(tags));
+ if (i < LENGTH(tags)) {
+ arg->ui = 1 << i;
+ }
+ return ClkTagBar;
+}
diff --git a/patch/bar_tags.h b/patch/bar_tags.h
new file mode 100644
index 0000000..033130e
--- /dev/null
+++ b/patch/bar_tags.h
@@ -0,0 +1,3 @@
+static int width_tags(Bar *bar, BarWidthArg *a);
+static int draw_tags(Bar *bar, BarDrawArg *a);
+static int click_tags(Bar *bar, Arg *arg, BarClickArg *a); \ No newline at end of file
diff --git a/patch/vtcolors.c b/patch/bar_vtcolors.c
index 349970f..349970f 100644
--- a/patch/vtcolors.c
+++ b/patch/bar_vtcolors.c
diff --git a/patch/vtcolors.h b/patch/bar_vtcolors.h
index 7341e6a..7341e6a 100644
--- a/patch/vtcolors.h
+++ b/patch/bar_vtcolors.h
diff --git a/patch/bar_wintitle.c b/patch/bar_wintitle.c
new file mode 100644
index 0000000..70c42ce
--- /dev/null
+++ b/patch/bar_wintitle.c
@@ -0,0 +1,88 @@
+int
+width_wintitle(Bar *bar, BarWidthArg *a)
+{
+ return a->max_width;
+}
+
+int
+draw_wintitle(Bar *bar, BarDrawArg *a)
+{
+ #if !BAR_ACTIVETAGINDICATORBAR_PATCH && !BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH
+ #if BAR_PANGO_PATCH
+ int boxs = drw->font->h / 9;
+ #else
+ int boxs = drw->fonts->h / 9;
+ #endif // BAR_PANGO_PATCH
+ #endif // BAR_ACTIVETAGINDICATORBAR_PATCH | BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH
+ #if BAR_PANGO_PATCH
+ int boxw = drw->font->h / 6 + 2;
+ #else
+ int boxw = drw->fonts->h / 6 + 2;
+ #endif // BAR_PANGO_PATCH
+
+ #if BAR_TITLE_LEFT_PAD && BAR_TITLE_RIGHT_PAD
+ int x = a->x + lrpad / 2, w = a->w - lrpad;
+ #elif BAR_TITLE_LEFT_PAD
+ int x = a->x + lrpad / 2, w = a->w - lrpad / 2;
+ #elif BAR_TITLE_RIGHT_PAD
+ int x = a->x, w = a->w - lrpad / 2;
+ #else
+ int x = a->x, w = a->w;
+ #endif // BAR_TITLE_LEFT_PAD | BAR_TITLE_RIGHT_PAD
+ Monitor *m = bar->mon;
+
+ if (m->sel) {
+ #if BAR_VTCOLORS_PATCH
+ drw_setscheme(drw, scheme[m == selmon ? SchemeTitleSel : SchemeTitleNorm]);
+ #elif BAR_TITLECOLOR_PATCH
+ drw_setscheme(drw, scheme[m == selmon ? SchemeTitle : SchemeNorm]);
+ #else
+ drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
+ #endif // BAR_VTCOLORS_PATCH / BAR_TITLECOLOR_PATCH
+ #if BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
+ XSetErrorHandler(xerrordummy);
+ #endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
+ #if BAR_CENTEREDWINDOWNAME_PATCH
+ int mid = (m->ww - TEXTW(m->sel->name)) / 2 - x;
+ #if BAR_PANGO_PATCH
+ drw_text(drw, x, 0, w, bh, mid, m->sel->name, 0, False);
+ #else
+ drw_text(drw, x, 0, w, bh, mid, m->sel->name, 0);
+ #endif // BAR_PANGO_PATCH
+ #else
+ #if BAR_PANGO_PATCH
+ drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0, False);
+ #else
+ drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
+ #endif // BAR_PANGO_PATCH
+ #endif // BAR_CENTEREDWINDOWNAME_PATCH
+ #if BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
+ XSync(dpy, False);
+ XSetErrorHandler(xerror);
+ #endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
+ if (m->sel->isfloating)
+ #if BAR_ACTIVETAGINDICATORBAR_PATCH
+ drw_rect(drw, x + boxw, 0, w - ( 2 * boxw + 1), boxw, m->sel->isfixed, 0);
+ #elif BAR_ACTIVETAGINDICATORBAR_ALT1_PATCH
+ drw_rect(drw, x + boxw, bh - boxw/2, w - ( 2 * boxw + 1), boxw/2, 0);
+ #else
+ drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
+ #endif // BAR_ACTIVETAGINDICATORBAR_PATCH
+ } else {
+ #if BAR_VTCOLORS_PATCH
+ drw_setscheme(drw, scheme[SchemeTitleNorm]);
+ #else
+ drw_setscheme(drw, scheme[SchemeNorm]);
+ #endif // BAR_VTCOLORS_PATCH
+ drw_rect(drw, x, 0, w, bh, 1, 1);
+ }
+ return x + w;
+}
+
+int
+click_wintitle(Bar *bar, Arg *arg, BarClickArg *a)
+{
+ return ClkWinTitle;
+}
+
+
diff --git a/patch/bar_wintitle.h b/patch/bar_wintitle.h
new file mode 100644
index 0000000..6d055a6
--- /dev/null
+++ b/patch/bar_wintitle.h
@@ -0,0 +1,3 @@
+static int width_wintitle(Bar *bar, BarWidthArg *a);
+static int draw_wintitle(Bar *bar, BarDrawArg *a);
+static int click_wintitle(Bar *bar, Arg *arg, BarClickArg *a); \ No newline at end of file
diff --git a/patch/combo.c b/patch/combo.c
index 907b645..43f7e5d 100644
--- a/patch/combo.c
+++ b/patch/combo.c
@@ -1,12 +1,12 @@
static int combo = 0;
-#if !HOLDBAR_PATCH
+#if !BAR_HOLDBAR_PATCH
void
keyrelease(XEvent *e)
{
combo = 0;
}
-#endif // !HOLDBAR_PATCH
+#endif // !BAR_HOLDBAR_PATCH
void
combotag(const Arg *arg)
diff --git a/patch/combo.h b/patch/combo.h
index 08be95e..752f636 100644
--- a/patch/combo.h
+++ b/patch/combo.h
@@ -1,5 +1,5 @@
-#if !HOLDBAR_PATCH
+#if !BAR_HOLDBAR_PATCH
static void keyrelease(XEvent *e);
-#endif // !HOLDBAR_PATCH
+#endif // !BAR_HOLDBAR_PATCH
static void combotag(const Arg *arg);
static void comboview(const Arg *arg); \ No newline at end of file
diff --git a/patch/holdbar.c b/patch/holdbar.c
deleted file mode 100644
index e3a5bfc..0000000
--- a/patch/holdbar.c
+++ /dev/null
@@ -1,99 +0,0 @@
-void
-holdbar(const Arg *arg)
-{
- if (selmon->showbar)
- return;
- selmon->showbar = 2;
- updateholdbarpos(selmon);
- #if BARPADDING_PATCH
- XMoveResizeWindow(dpy, selmon->barwin, selmon->wx + sp, selmon->by + vp, selmon->ww - 2 * sp, bh);
- #else
- XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
- #endif // BARPADDING_PATCH
- #if EXTRABAR_PATCH
- #if BARPADDING_PATCH
- XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx + sp, selmon->eby - vp, selmon->ww - 2 * sp, bh);
- #else
- XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx, selmon->eby, selmon->ww, bh);
- #endif // BARPADDING_PATCH
- #endif // EXTRABAR_PATCH
-}
-
-void
-keyrelease(XEvent *e)
-{
- if (XEventsQueued(dpy, QueuedAfterReading)) {
- XEvent ne;
- XPeekEvent(dpy, &ne);
-
- if (ne.type == KeyPress && ne.xkey.time == e->xkey.time &&
- ne.xkey.keycode == e->xkey.keycode) {
- XNextEvent(dpy, &ne);
- return;
- }
- }
- if (e->xkey.keycode == XKeysymToKeycode(dpy, HOLDKEY) && selmon->showbar == 2) {
- selmon->showbar = 0;
- updateholdbarpos(selmon);
- #if BARPADDING_PATCH
- XMoveResizeWindow(dpy, selmon->barwin, selmon->wx + sp, selmon->by + vp, selmon->ww - 2 * sp, bh);
- #else
- XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
- #endif // BARPADDING_PATCH
- #if EXTRABAR_PATCH
- #if BARPADDING_PATCH
- XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx + sp, selmon->eby - vp, selmon->ww - 2 * sp, bh);
- #else
- XMoveResizeWindow(dpy, selmon->extrabarwin, selmon->wx, selmon->eby, selmon->ww, bh);
- #endif // BARPADDING_PATCH
- #endif // EXTRABAR_PATCH
- arrange(selmon);
- }
- #if COMBO_PATCH
- combo = 0;
- #endif // COMBO_PATCH
-}
-
-void
-updateholdbarpos(Monitor *m)
-{
- m->wy = m->my;
- m->wh = m->mh;
- #if EXTRABAR_PATCH
- #if BARPADDING_PATCH
- m->wh = m->wh - vertpad * m->showbar * 2 - bh * m->showbar * 2;
- m->wy = m->showbar ? m->wy + bh + vertpad: m->wy;
- if (m->showbar) {
- m->by = m->topbar ? m->wy - bh - vertpad: m->wy + m->wh + vertpad;
- m->eby = m->topbar ? m->wy + m->wh + vertpad: m->wy - bh - vertpad;
- } else {
- m->by = -bh - vertpad;
- m->eby = -bh - vertpad;
- }
- #else
- m->wh = m->wh - bh * m->showbar * 2;
- m->wy = m->showbar ? m->wy + bh : m->wy;
- if (m->showbar) {
- m->by = m->topbar ? m->wy - bh : m->wy + m->wh;
- m->eby = m->topbar ? m->wy + m->wh : m->wy - bh;
- } else {
- m->by = -bh;
- m->eby = -bh;
- }
- #endif // BARPADDING_PATCH
- #elif BARPADDING_PATCH
- if (m->showbar) {
- m->wh = m->wh - vertpad - bh;
- m->by = m->topbar ? m->wy : m->wy + m->wh + vertpad;
- m->wy = m->topbar ? m->wy + bh + vp : m->wy;
- } else
- m->by = -bh - vp;
- #else
- if (m->showbar) {
- m->wh -= bh;
- m->by = m->topbar ? m->wy : m->wy + m->wh;
- m->wy = m->topbar ? m->wy + bh : m->wy;
- } else
- m->by = -bh;
- #endif // EXTRABAR_PATCH
-}
diff --git a/patch/holdbar.h b/patch/holdbar.h
deleted file mode 100644
index 719b9ea..0000000
--- a/patch/holdbar.h
+++ /dev/null
@@ -1,3 +0,0 @@
-static void keyrelease(XEvent *e);
-static void holdbar(const Arg *arg);
-static void updateholdbarpos(Monitor *m); \ No newline at end of file
diff --git a/patch/include.c b/patch/include.c
index d574fd6..cef9234 100644
--- a/patch/include.c
+++ b/patch/include.c
@@ -1,45 +1,86 @@
-/* Patches */
-#if ALPHA_PATCH
-#include "alpha.c"
+/* Bar functionality */
+#if BAR_ALPHA_PATCH
+#include "bar_alpha.c"
#endif
-#if ALTERNATIVE_TAGS_PATCH
-#include "alternativetags.c"
+#if BAR_ALTERNATIVE_TAGS_PATCH
+#include "bar_alternativetags.c"
#endif
+#if BAR_DWMBLOCKS_PATCH && BAR_STATUSCMD_PATCH
+#include "bar_dwmblocks.c"
+#endif
+#if BAR_EWMHTAGS_PATCH
+#include "bar_ewmhtags.c"
+#endif
+#if COMBO_PATCH
+#include "combo.c"
+#endif
+#if BAR_HOLDBAR_PATCH
+#include "bar_holdbar.c"
+#endif
+#if BAR_LTSYMBOL_PATCH
+#include "bar_ltsymbol.c"
+#endif
+#if BAR_STATUS_PATCH
+#include "bar_status.c"
+#endif
+#if BAR_STATUS2D_PATCH
+#include "bar_status2d.c"
+#endif
+#if BAR_STATUSBUTTON_PATCH
+#include "bar_statusbutton.c"
+#endif
+#if BAR_STATUSCMD_PATCH
+#include "bar_statuscmd.c"
+#endif
+#if BAR_STATUSCOLORS_PATCH
+#include "bar_statuscolors.c"
+#endif
+#if BAR_TAGS_PATCH
+#include "bar_tags.c"
+#endif
+#if BAR_TAGGRID_PATCH
+#include "bar_taggrid.c"
+#endif
+#if BAR_WINTITLE_PATCH
+#include "bar_wintitle.c"
+#endif
+#if BAR_FANCYBAR_PATCH
+#include "bar_fancybar.c"
+#endif
+#if BAR_AWESOMEBAR_PATCH
+#include "bar_awesomebar.c"
+#endif
+#if BAR_SYSTRAY_PATCH
+#include "bar_systray.c"
+#endif
+#if BAR_VTCOLORS_PATCH
+#include "bar_vtcolors.c"
+#endif
+
+/* Other patches */
#if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH
#include "attachx.c"
#endif
#if AUTOSTART_PATCH
#include "autostart.c"
#endif
-#if AWESOMEBAR_PATCH
-#include "awesomebar.c"
-#endif
#if CFACTS_PATCH
#include "cfacts.c"
#endif
#if CMDCUSTOMIZE_PATCH
#include "cmdcustomize.c"
#endif
-#if COMBO_PATCH
-#include "combo.c"
-#endif
#if CYCLELAYOUTS_PATCH
#include "cyclelayouts.c"
#endif
#if DRAGCFACT_PATCH && CFACTS_PATCH
#include "dragcfact.c"
#endif
-#if DWMBLOCKS_PATCH && STATUSCMD_PATCH
-#include "dwmblocks.c"
-#endif
#if DWMC_PATCH
#include "dwmc.c"
#elif FSIGNAL_PATCH
#include "fsignal.c"
#endif
-#if EWMHTAGS_PATCH
-#include "ewmhtags.c"
-#endif
#if EXRESIZE_PATCH
#include "exresize.c"
#endif
@@ -58,9 +99,6 @@
#if FULLSCREEN_PATCH
#include "fullscreen.c"
#endif
-#if HOLDBAR_PATCH
-#include "holdbar.c"
-#endif
#if INPLACEROTATE_PATCH
#include "inplacerotate.c"
#endif
@@ -131,21 +169,9 @@
#if STACKER_PATCH
#include "stacker.c"
#endif
-#if STATUS2D_PATCH && !STATUSCOLORS_PATCH
-#include "status2d.c"
-#endif
-#if STATUSCOLORS_PATCH
-#include "statuscolors.c"
-#endif
-#if STATUSCMD_PATCH
-#include "statuscmd.c"
-#endif
#if STICKY_PATCH
#include "sticky.c"
#endif
-#if SYSTRAY_PATCH
-#include "systray.c"
-#endif
#if SWALLOW_PATCH
#include "swallow.c"
#endif
@@ -164,9 +190,6 @@
#if TAGALLMON_PATCH
#include "tagallmon.c"
#endif
-#if TAGGRID_PATCH
-#include "taggrid.c"
-#endif
#if TAGOTHERMONITOR_PATCH
#include "tagothermonitor.c"
#endif
@@ -188,9 +211,6 @@
#if VANITYGAPS_PATCH
#include "vanitygaps.c"
#endif
-#if VTCOLORS_PATCH
-#include "vtcolors.c"
-#endif
#if WARP_PATCH
#include "warp.c"
#endif
@@ -200,7 +220,7 @@
#if ZOOMSWAP_PATCH
#include "zoomswap.c"
#endif
-#if XRDB_PATCH && !VTCOLORS_PATCH
+#if XRDB_PATCH && !BAR_VTCOLORS_PATCH
#include "xrdb.c"
#endif
#if DRAGMFACT_PATCH
@@ -211,44 +231,44 @@
#include "layout_facts.c"
#endif
#if BSTACK_LAYOUT
-#include "bstack.c"
+#include "layout_bstack.c"
#endif
#if BSTACKHORIZ_LAYOUT
-#include "bstackhoriz.c"
+#include "layout_bstackhoriz.c"
#endif
#if CENTEREDMASTER_LAYOUT
-#include "centeredmaster.c"
+#include "layout_centeredmaster.c"
#endif
#if CENTEREDFLOATINGMASTER_LAYOUT
-#include "centeredfloatingmaster.c"
+#include "layout_centeredfloatingmaster.c"
#endif
#if COLUMNS_LAYOUT
-#include "columns.c"
+#include "layout_columns.c"
#endif
#if DECK_LAYOUT
-#include "deck.c"
+#include "layout_deck.c"
#endif
#if FIBONACCI_DWINDLE_LAYOUT || FIBONACCI_SPIRAL_LAYOUT
-#include "fibonacci.c"
+#include "layout_fibonacci.c"
#endif
#if FLEXTILE_DELUXE_LAYOUT
-#include "flextile-deluxe.c"
+#include "layout_flextile-deluxe.c"
#endif
#if GAPPLESSGRID_LAYOUT
-#include "gapplessgrid.c"
+#include "layout_gapplessgrid.c"
#endif
#if GRIDMODE_LAYOUT
-#include "grid.c"
+#include "layout_grid.c"
#endif
#if HORIZGRID_LAYOUT
-#include "horizgrid.c"
+#include "layout_horizgrid.c"
#endif
#if MONOCLE_LAYOUT
-#include "monocle.c"
+#include "layout_monocle.c"
#endif
#if NROWGRID_LAYOUT
-#include "nrowgrid.c"
+#include "layout_nrowgrid.c"
#endif
#if TILE_LAYOUT
-#include "tile.c"
-#endif
+#include "layout_tile.c"
+#endif \ No newline at end of file
diff --git a/patch/include.h b/patch/include.h
index 97628aa..8b1d470 100644
--- a/patch/include.h
+++ b/patch/include.h
@@ -1,28 +1,72 @@
-/* Patches */
-#if ALPHA_PATCH
-#include "alpha.h"
+/* Bar functionality */
+#if BAR_ALPHA_PATCH
+#include "bar_alpha.h"
#endif
-#if ALTERNATIVE_TAGS_PATCH
-#include "alternativetags.h"
+#if BAR_ALTERNATIVE_TAGS_PATCH
+#include "bar_alternativetags.h"
#endif
+#if BAR_DWMBLOCKS_PATCH && BAR_STATUSCMD_PATCH
+#include "bar_dwmblocks.h"
+#endif
+#if BAR_EWMHTAGS_PATCH
+#include "bar_ewmhtags.h"
+#endif
+#if COMBO_PATCH
+#include "combo.h"
+#endif
+#if BAR_HOLDBAR_PATCH
+#include "bar_holdbar.h"
+#endif
+#if BAR_LTSYMBOL_PATCH
+#include "bar_ltsymbol.h"
+#endif
+#if BAR_STATUS_PATCH
+#include "bar_status.h"
+#endif
+#if BAR_STATUS2D_PATCH
+#include "bar_status2d.h"
+#endif
+#if BAR_STATUSBUTTON_PATCH
+#include "bar_statusbutton.h"
+#endif
+#if BAR_STATUSCMD_PATCH
+#include "bar_statuscmd.h"
+#endif
+#if BAR_TAGS_PATCH
+#include "bar_tags.h"
+#endif
+#if BAR_TAGGRID_PATCH
+#include "bar_taggrid.h"
+#endif
+#if BAR_WINTITLE_PATCH
+#include "bar_wintitle.h"
+#endif
+#if BAR_FANCYBAR_PATCH
+#include "bar_fancybar.h"
+#endif
+#if BAR_AWESOMEBAR_PATCH
+#include "bar_awesomebar.h"
+#endif
+#if BAR_SYSTRAY_PATCH
+#include "bar_systray.h"
+#endif
+#if BAR_VTCOLORS_PATCH
+#include "bar_vtcolors.h"
+#endif
+
+/* Other patches */
#if ATTACHABOVE_PATCH || ATTACHASIDE_PATCH || ATTACHBELOW_PATCH || ATTACHBOTTOM_PATCH
#include "attachx.h"
#endif
#if AUTOSTART_PATCH
#include "autostart.h"
#endif
-#if AWESOMEBAR_PATCH
-#include "awesomebar.h"
-#endif
#if CFACTS_PATCH
#include "cfacts.h"
#endif
#if CMDCUSTOMIZE_PATCH
#include "cmdcustomize.h"
#endif
-#if COMBO_PATCH
-#include "combo.h"
-#endif
#if CYCLELAYOUTS_PATCH
#include "cyclelayouts.h"
#endif
@@ -32,17 +76,11 @@
#if DRAGMFACT_PATCH
#include "dragmfact.h"
#endif
-#if DWMBLOCKS_PATCH && STATUSCMD_PATCH
-#include "dwmblocks.h"
-#endif
#if DWMC_PATCH
#include "dwmc.h"
#elif FSIGNAL_PATCH
#include "fsignal.h"
#endif
-#if EWMHTAGS_PATCH
-#include "ewmhtags.h"
-#endif
#if EXRESIZE_PATCH
#include "exresize.h"
#endif
@@ -61,9 +99,6 @@
#if FULLSCREEN_PATCH
#include "fullscreen.h"
#endif
-#if HOLDBAR_PATCH
-#include "holdbar.h"
-#endif
#if INPLACEROTATE_PATCH
#include "inplacerotate.h"
#endif
@@ -134,18 +169,9 @@
#if STACKER_PATCH
#include "stacker.h"
#endif
-#if STATUS2D_PATCH && !STATUSCOLORS_PATCH
-#include "status2d.h"
-#endif
-#if STATUSCMD_PATCH
-#include "statuscmd.h"
-#endif
#if STICKY_PATCH
#include "sticky.h"
#endif
-#if SYSTRAY_PATCH
-#include "systray.h"
-#endif
#if SWALLOW_PATCH
#include "swallow.h"
#endif
@@ -164,9 +190,6 @@
#if TAGALLMON_PATCH
#include "tagallmon.h"
#endif
-#if TAGGRID_PATCH
-#include "taggrid.h"
-#endif
#if TAGOTHERMONITOR_PATCH
#include "tagothermonitor.h"
#endif
@@ -188,9 +211,6 @@
#if VANITYGAPS_PATCH
#include "vanitygaps.h"
#endif
-#if VTCOLORS_PATCH
-#include "vtcolors.h"
-#endif
#if WARP_PATCH
#include "warp.h"
#endif
@@ -200,49 +220,49 @@
#if ZOOMSWAP_PATCH
#include "zoomswap.h"
#endif
-#if XRDB_PATCH && !VTCOLORS_PATCH
+#if XRDB_PATCH && !BAR_VTCOLORS_PATCH
#include "xrdb.h"
#endif
/* Layouts */
#if BSTACK_LAYOUT
-#include "bstack.h"
+#include "layout_bstack.h"
#endif
#if BSTACKHORIZ_LAYOUT
-#include "bstackhoriz.h"
+#include "layout_bstackhoriz.h"
#endif
#if CENTEREDMASTER_LAYOUT
-#include "centeredmaster.h"
+#include "layout_centeredmaster.h"
#endif
#if CENTEREDFLOATINGMASTER_LAYOUT
-#include "centeredfloatingmaster.h"
+#include "layout_centeredfloatingmaster.h"
#endif
#if COLUMNS_LAYOUT
-#include "columns.h"
+#include "layout_columns.h"
#endif
#if DECK_LAYOUT
-#include "deck.h"
+#include "layout_deck.h"
#endif
#if FIBONACCI_DWINDLE_LAYOUT || FIBONACCI_SPIRAL_LAYOUT
-#include "fibonacci.h"
+#include "layout_fibonacci.h"
#endif
#if FLEXTILE_DELUXE_LAYOUT
-#include "flextile-deluxe.h"
+#include "layout_flextile-deluxe.h"
#endif
#if GAPPLESSGRID_LAYOUT
-#include "gapplessgrid.h"
+#include "layout_gapplessgrid.h"
#endif
#if GRIDMODE_LAYOUT
-#include "grid.h"
+#include "layout_grid.h"
#endif
#if HORIZGRID_LAYOUT
-#include "horizgrid.h"
+#include "layout_horizgrid.h"
#endif
#if MONOCLE_LAYOUT
-#include "monocle.h"
+#include "layout_monocle.h"
#endif
#if NROWGRID_LAYOUT
-#include "nrowgrid.h"
+#include "layout_nrowgrid.h"
#endif
#if TILE_LAYOUT
-#include "tile.h"
-#endif
+#include "layout_tile.h"
+#endif \ No newline at end of file
diff --git a/patch/killunsel.c b/patch/killunsel.c
index 1e15d2b..774847b 100644
--- a/patch/killunsel.c
+++ b/patch/killunsel.c
@@ -8,11 +8,11 @@ killunsel(const Arg *arg)
for (i = selmon->clients; i; i = i->next) {
if (ISVISIBLE(i) && i != selmon->sel) {
- #if SYSTRAY_PATCH
+ #if BAR_SYSTRAY_PATCH
if (!sendevent(i->win, wmatom[WMDelete], NoEventMask, wmatom[WMDelete], CurrentTime, 0, 0, 0))
#else
if (!sendevent(i, wmatom[WMDelete]))
- #endif // SYSTRAY_PATCH
+ #endif // BAR_SYSTRAY_PATCH
{
XGrabServer(dpy);
XSetErrorHandler(xerrordummy);
diff --git a/patch/bstack.c b/patch/layout_bstack.c
index be06647..be06647 100644
--- a/patch/bstack.c
+++ b/patch/layout_bstack.c
diff --git a/patch/bstack.h b/patch/layout_bstack.h
index 56c99ff..56c99ff 100644
--- a/patch/bstack.h
+++ b/patch/layout_bstack.h
diff --git a/patch/bstackhoriz.c b/patch/layout_bstackhoriz.c
index 0f9042f..0f9042f 100644
--- a/patch/bstackhoriz.c
+++ b/patch/layout_bstackhoriz.c
diff --git a/patch/bstackhoriz.h b/patch/layout_bstackhoriz.h
index 8dd0ebd..8dd0ebd 100644
--- a/patch/bstackhoriz.h
+++ b/patch/layout_bstackhoriz.h
diff --git a/patch/centeredfloatingmaster.c b/patch/layout_centeredfloatingmaster.c
index 756b41f..756b41f 100644
--- a/patch/centeredfloatingmaster.c
+++ b/patch/layout_centeredfloatingmaster.c
diff --git a/patch/centeredfloatingmaster.h b/patch/layout_centeredfloatingmaster.h
index e4147b3..e4147b3 100644
--- a/patch/centeredfloatingmaster.h
+++ b/patch/layout_centeredfloatingmaster.h
diff --git a/patch/centeredmaster.c b/patch/layout_centeredmaster.c
index a72eb07..a72eb07 100644
--- a/patch/centeredmaster.c
+++ b/patch/layout_centeredmaster.c
diff --git a/patch/centeredmaster.h b/patch/layout_centeredmaster.h
index b047212..b047212 100644
--- a/patch/centeredmaster.h
+++ b/patch/layout_centeredmaster.h
diff --git a/patch/columns.c b/patch/layout_columns.c
index bcdaa11..bcdaa11 100644
--- a/patch/columns.c
+++ b/patch/layout_columns.c
diff --git a/patch/columns.h b/patch/layout_columns.h
index 8f64a09..8f64a09 100644
--- a/patch/columns.h
+++ b/patch/layout_columns.h
diff --git a/patch/deck.c b/patch/layout_deck.c
index 6f2027d..6f2027d 100644
--- a/patch/deck.c
+++ b/patch/layout_deck.c
diff --git a/patch/deck.h b/patch/layout_deck.h
index abedeb2..abedeb2 100644
--- a/patch/deck.h
+++ b/patch/layout_deck.h
diff --git a/patch/fibonacci.c b/patch/layout_fibonacci.c
index 87a1bdf..87a1bdf 100644
--- a/patch/fibonacci.c
+++ b/patch/layout_fibonacci.c
diff --git a/patch/fibonacci.h b/patch/layout_fibonacci.h
index a15eb76..a15eb76 100644
--- a/patch/fibonacci.h
+++ b/patch/layout_fibonacci.h
diff --git a/patch/flextile-deluxe.c b/patch/layout_flextile-deluxe.c
index a877c92..a877c92 100644
--- a/patch/flextile-deluxe.c
+++ b/patch/layout_flextile-deluxe.c
diff --git a/patch/flextile-deluxe.h b/patch/layout_flextile-deluxe.h
index 01bce7b..01bce7b 100644
--- a/patch/flextile-deluxe.h
+++ b/patch/layout_flextile-deluxe.h
diff --git a/patch/gapplessgrid.c b/patch/layout_gapplessgrid.c
index 0330181..0330181 100644
--- a/patch/gapplessgrid.c
+++ b/patch/layout_gapplessgrid.c
diff --git a/patch/gapplessgrid.h b/patch/layout_gapplessgrid.h
index 28a7b5d..28a7b5d 100644
--- a/patch/gapplessgrid.h
+++ b/patch/layout_gapplessgrid.h
diff --git a/patch/grid.c b/patch/layout_grid.c
index df19896..df19896 100644
--- a/patch/grid.c
+++ b/patch/layout_grid.c
diff --git a/patch/grid.h b/patch/layout_grid.h
index 81149ce..81149ce 100644
--- a/patch/grid.h
+++ b/patch/layout_grid.h
diff --git a/patch/horizgrid.c b/patch/layout_horizgrid.c
index 48f66ab..48f66ab 100644
--- a/patch/horizgrid.c
+++ b/patch/layout_horizgrid.c
diff --git a/patch/horizgrid.h b/patch/layout_horizgrid.h
index 71a57fb..71a57fb 100644
--- a/patch/horizgrid.h
+++ b/patch/layout_horizgrid.h
diff --git a/patch/monocle.c b/patch/layout_monocle.c
index 1533aa9..1533aa9 100644
--- a/patch/monocle.c
+++ b/patch/layout_monocle.c
diff --git a/patch/monocle.h b/patch/layout_monocle.h
index d3df960..d3df960 100644
--- a/patch/monocle.h
+++ b/patch/layout_monocle.h
diff --git a/patch/nrowgrid.c b/patch/layout_nrowgrid.c
index 5709d80..5709d80 100644
--- a/patch/nrowgrid.c
+++ b/patch/layout_nrowgrid.c
diff --git a/patch/nrowgrid.h b/patch/layout_nrowgrid.h
index de71a50..de71a50 100644
--- a/patch/nrowgrid.h
+++ b/patch/layout_nrowgrid.h
diff --git a/patch/tile.c b/patch/layout_tile.c
index fa0b90a..fa0b90a 100644
--- a/patch/tile.c
+++ b/patch/layout_tile.c
diff --git a/patch/tile.h b/patch/layout_tile.h
index 8730e13..8730e13 100644
--- a/patch/tile.h
+++ b/patch/layout_tile.h
diff --git a/patch/movestack.c b/patch/movestack.c
index 2406a87..ab97b18 100644
--- a/patch/movestack.c
+++ b/patch/movestack.c
@@ -2,13 +2,13 @@ void
movestack(const Arg *arg)
{
Client *c = NULL, *p = NULL, *pc = NULL, *i;
-
if (arg->i > 0) {
+ if (!selmon->sel)
+ return;
/* find the client after selmon->sel */
for (c = selmon->sel->next; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
if (!c)
for (c = selmon->clients; c && (!ISVISIBLE(c) || c->isfloating); c = c->next);
-
}
else {
/* find the client before selmon->sel */
@@ -20,6 +20,7 @@ movestack(const Arg *arg)
if (ISVISIBLE(i) && !i->isfloating)
c = i;
}
+
/* find the client before selmon->sel and c */
for (i = selmon->clients; i && (!p || !pc); i = i->next) {
if (i->next == selmon->sel)
diff --git a/patch/status2d.h b/patch/status2d.h
deleted file mode 100644
index 7688807..0000000
--- a/patch/status2d.h
+++ /dev/null
@@ -1,2 +0,0 @@
-static int drawstatusbar(Monitor *m, int bh, char* text, int stw, int stp, int align);
-static int status2dtextlength(char* stext); \ No newline at end of file
diff --git a/patch/statuscmd.c b/patch/statuscmd.c
deleted file mode 100644
index b38739d..0000000
--- a/patch/statuscmd.c
+++ /dev/null
@@ -1,18 +0,0 @@
-#if !DWMBLOCKS_PATCH
-static const char statusexport[] = "export BUTTON=-;";
-static int statuscmdn;
-static int lastbutton;
-#endif // DWMBLOCKS_PATCH
-
-void
-copyvalidchars(char *text, char *rawtext)
-{
- int i = -1, j = 0;
-
- while (rawtext[++i]) {
- if ((unsigned char)rawtext[i] >= ' ') {
- text[j++] = rawtext[i];
- }
- }
- text[j] = '\0';
-}
diff --git a/patch/statuscmd.h b/patch/statuscmd.h
deleted file mode 100644
index 77391b6..0000000
--- a/patch/statuscmd.h
+++ /dev/null
@@ -1 +0,0 @@
-static void copyvalidchars(char *text, char *rawtext); \ No newline at end of file
diff --git a/patch/taggrid.c b/patch/taggrid.c
deleted file mode 100644
index bfa19ec..0000000
--- a/patch/taggrid.c
+++ /dev/null
@@ -1,118 +0,0 @@
-void drawtaggrid(Monitor *m, int *x_pos, unsigned int occ)
-{
- unsigned int x, y, h, max_x, columns;
- int invert, i,j, k;
-
- h = bh / tagrows;
- x = max_x = *x_pos;
- y = 0;
- columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0);
-
- /* Firstly we will fill the borders of squares */
-
- XSetForeground(drw->dpy, drw->gc, scheme[SchemeNorm][ColBorder].pixel);
- XFillRectangle(dpy, drw->drawable, drw->gc, x, y, h*columns + 1, bh);
-
- /* We will draw LENGTH(tags) squares in tagraws raws. */
- for (j = 0, i= 0; j < tagrows; j++) {
- x = *x_pos;
- for (k = 0; k < columns && i < LENGTH(tags); k++, i++) {
- invert = m->tagset[m->seltags] & 1 << i ? 0 : 1;
-
- /* Select active color for current square */
- XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeSel][ColBg].pixel :
- scheme[SchemeNorm][ColFg].pixel);
- XFillRectangle(dpy, drw->drawable, drw->gc, x+1, y+1, h-1, h-1);
-
- /* Mark square if tag has client */
- if (occ & 1 << i) {
- XSetForeground(drw->dpy, drw->gc, !invert ? scheme[SchemeSel][ColFg].pixel :
- scheme[SchemeNorm][ColBg].pixel);
- XFillRectangle(dpy, drw->drawable, drw->gc, x + 1, y + 1,
- h / 2, h / 2);
- }
- x += h;
- if (x > max_x) {
- max_x = x;
- }
- }
- y += h;
- }
- *x_pos = max_x + 1;
-}
-
-void switchtag(const Arg *arg)
-{
- unsigned int columns;
- unsigned int new_tagset = 0;
- unsigned int pos, i;
- int col, row;
- Arg new_arg;
-
- columns = LENGTH(tags) / tagrows + ((LENGTH(tags) % tagrows > 0) ? 1 : 0);
-
- for (i = 0; i < LENGTH(tags); ++i) {
- if (!(selmon->tagset[selmon->seltags] & 1 << i)) {
- continue;
- }
- pos = i;
- row = pos / columns;
- col = pos % columns;
- if (arg->ui & SWITCHTAG_UP) { /* UP */
- row --;
- if (row < 0) {
- row = tagrows - 1;
- }
- do {
- pos = row * columns + col;
- row --;
- } while (pos >= LENGTH(tags));
- }
- if (arg->ui & SWITCHTAG_DOWN) { /* DOWN */
- row ++;
- if (row >= tagrows) {
- row = 0;
- }
- pos = row * columns + col;
- if (pos >= LENGTH(tags)) {
- row = 0;
- }
- pos = row * columns + col;
- }
- if (arg->ui & SWITCHTAG_LEFT) { /* LEFT */
- col --;
- if (col < 0) {
- col = columns - 1;
- }
- do {
- pos = row * columns + col;
- col --;
- } while (pos >= LENGTH(tags));
- }
- if (arg->ui & SWITCHTAG_RIGHT) { /* RIGHT */
- col ++;
- if (col >= columns) {
- col = 0;
- }
- pos = row * columns + col;
- if (pos >= LENGTH(tags)) {
- col = 0;
- pos = row * columns + col;
- }
- }
- new_tagset |= 1 << pos;
- }
- new_arg.ui = new_tagset;
- if (arg->ui & SWITCHTAG_TOGGLETAG) {
- toggletag(&new_arg);
- }
- if (arg->ui & SWITCHTAG_TAG) {
- tag(&new_arg);
- }
- if (arg->ui & SWITCHTAG_VIEW) {
- view (&new_arg);
- }
- if (arg->ui & SWITCHTAG_TOGGLEVIEW) {
- toggleview (&new_arg);
- }
-} \ No newline at end of file
diff --git a/patch/taggrid.h b/patch/taggrid.h
deleted file mode 100644
index 27343a6..0000000
--- a/patch/taggrid.h
+++ /dev/null
@@ -1,2 +0,0 @@
-static void drawtaggrid(Monitor *m, int *x_pos, unsigned int occ);
-static void switchtag(const Arg *arg); \ No newline at end of file
diff --git a/patch/xrdb.c b/patch/xrdb.c
index ef9e186..f3bd38a 100644
--- a/patch/xrdb.c
+++ b/patch/xrdb.c
@@ -30,16 +30,16 @@ loadxrdb()
XRDB_LOAD_COLOR("dwm.selfloatcolor", selfloatcolor);
#endif // FLOAT_BORDER_COLOR_PATCH
- #if STATUSCOLORS_PATCH
+ #if BAR_STATUSCOLORS_PATCH
XRDB_LOAD_COLOR("dwm.warnfgcolor", warnfgcolor);
XRDB_LOAD_COLOR("dwm.warnbgcolor", warnbgcolor);
XRDB_LOAD_COLOR("dwm.warnbordercolor", warnbordercolor);
#if FLOAT_BORDER_COLOR_PATCH
XRDB_LOAD_COLOR("dwm.warnfloatcolor", warnfloatcolor);
#endif // FLOAT_BORDER_COLOR_PATCH
- #endif // STATUSCOLORS_PATCH
+ #endif // BAR_STATUSCOLORS_PATCH
- #if URGENTBORDER_PATCH || STATUSCOLORS_PATCH
+ #if URGENTBORDER_PATCH || BAR_STATUSCOLORS_PATCH
XRDB_LOAD_COLOR("dwm.urgfgcolor", urgfgcolor);
XRDB_LOAD_COLOR("dwm.urgbgcolor", urgbgcolor);
XRDB_LOAD_COLOR("dwm.urgbordercolor", urgbordercolor);
@@ -57,14 +57,14 @@ loadxrdb()
#endif // FLOAT_BORDER_COLOR_PATCH
#endif // AWESOMEBAR_PATCH
- #if TITLECOLOR_PATCH
+ #if BAR_TITLECOLOR_PATCH
XRDB_LOAD_COLOR("dwm.titlefgcolor", titlefgcolor);
XRDB_LOAD_COLOR("dwm.titlebgcolor", titlebgcolor);
XRDB_LOAD_COLOR("dwm.titlebordercolor", titlebordercolor);
#if FLOAT_BORDER_COLOR_PATCH
XRDB_LOAD_COLOR("dwm.titlefloatcolor", titlefloatcolor);
#endif // FLOAT_BORDER_COLOR_PATCH
- #endif // TITLECOLOR_PATCH
+ #endif // BAR_TITLECOLOR_PATCH
}
}
}
@@ -79,9 +79,9 @@ xrdb(const Arg *arg)
int i;
for (i = 0; i < LENGTH(colors); i++)
scheme[i] = drw_scm_create(drw, colors[i],
- #if ALPHA_PATCH
+ #if BAR_ALPHA_PATCH
alphas[i],
- #endif // ALPHA_PATCH
+ #endif // BAR_ALPHA_PATCH
#if FLOAT_BORDER_COLOR_PATCH
4
#else