[wiki] [sites] [dwm][fancybar] Update for current master || Jochen Sprickerhof
commit bf35f717e684b5da49a5941bada7a0b7dc599671
Author: Jochen Sprickerhof <git_AT_jochen.sprickerhof.de>
Date: Thu Apr 23 07:42:23 2020 +0200
[dwm][fancybar] Update for current master
diff --git a/dwm.suckless.org/patches/fancybar/dwm-fancybar-20200423-ed3ab6b.diff b/dwm.suckless.org/patches/fancybar/dwm-fancybar-20200423-ed3ab6b.diff
new file mode 100644
index 00000000..a8aa2a03
--- /dev/null
+++ b/dwm.suckless.org/patches/fancybar/dwm-fancybar-20200423-ed3ab6b.diff
_AT_@ -0,0 +1,74 @@
+diff --git a/dwm.c b/dwm.c
+index fb1e326..941293e 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -696,10 +696,10 @@ dirtomon(int dir)
+ void
+ drawbar(Monitor *m)
+ {
+- int x, w, tw = 0;
++ int x, w, tw = 0, mw, ew = 0;
+ int boxs = drw->fonts->h / 9;
+ int boxw = drw->fonts->h / 6 + 2;
+- unsigned int i, occ = 0, urg = 0;
++ unsigned int i, occ = 0, urg = 0, n = 0;
+ Client *c;
+
+ /* draw status first so it can be overdrawn by tags later */
+_AT_@ -710,6 +710,8 @@ drawbar(Monitor *m)
+ }
+
+ for (c = m->clients; c; c = c->next) {
++ if (ISVISIBLE(c))
++ n++;
+ occ |= c->tags;
+ if (c->isurgent)
+ urg |= c->tags;
+_AT_@ -730,15 +732,39 @@ drawbar(Monitor *m)
+ x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
+
+ if ((w = m->ww - tw - x) > bh) {
+- if (m->sel) {
+- drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
+- drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
+- if (m->sel->isfloating)
+- drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
+- } else {
+- drw_setscheme(drw, scheme[SchemeNorm]);
+- drw_rect(drw, x, 0, w, bh, 1, 1);
++ if (n > 0) {
++ tw = TEXTW(m->sel->name) + lrpad;
++ mw = (tw >= w || n == 1) ? 0 : (w - tw) / (n - 1);
++
++ i = 0;
++ for (c = m->clients; c; c = c->next) {
++ if (!ISVISIBLE(c) || c == m->sel)
++ continue;
++ tw = TEXTW(c->name);
++ if(tw < mw)
++ ew += (mw - tw);
++ else
++ i++;
++ }
++ if (i > 0)
++ mw += ew / i;
++
++ for (c = m->clients; c; c = c->next) {
++ if (!ISVISIBLE(c))
++ continue;
++ tw = MIN(m->sel == c ? w : mw, TEXTW(c->name));
++
++ drw_setscheme(drw, scheme[m->sel == c ? SchemeSel : SchemeNorm]);
++ if (tw > 0) /* trap special handling of 0 in drw_text */
++ drw_text(drw, x, 0, tw, bh, lrpad / 2, c->name, 0);
++ if (c->isfloating)
++ drw_rect(drw, x + boxs, boxs, boxw, boxw, c->isfixed, 0);
++ x += tw;
++ w -= tw;
++ }
+ }
++ drw_setscheme(drw, scheme[SchemeNorm]);
++ drw_rect(drw, x, 0, w, bh, 1, 1);
+ }
+ drw_map(drw, m->barwin, 0, 0, m->ww, bh);
+ }
diff --git a/dwm.suckless.org/patches/fancybar/index.md b/dwm.suckless.org/patches/fancybar/index.md
index 7a21b18b..862476cf 100644
--- a/dwm.suckless.org/patches/fancybar/index.md
+++ b/dwm.suckless.org/patches/fancybar/index.md
_AT_@ -12,6 +12,7 @@ Download
* [dwm-fancybar-5.6.1.diff](dwm-fancybar-5.6.1.diff)
* [dwm-fancybar-6.1.diff](dwm-fancybar-6.1.diff)
* [dwm-fancybar-6.2.diff](dwm-fancybar-6.2.diff)
+* [dwm-fancybar-20200423-ed3ab6b.diff](dwm-fancybar-20200423-ed3ab6b.diff)
Author
------
Received on Thu Apr 23 2020 - 07:42:42 CEST
This archive was generated by hypermail 2.3.0
: Thu Apr 23 2020 - 07:48:46 CEST