[wiki] [sites] Updated tilegap patch to dwm 6.4. || midspec
commit f79134fe500f8a1cd192286fb1797e7c495d92bb
Author: midspec <obleque_AT_protonmail.com>
Date: Sat Nov 4 21:59:17 2023 +0000
Updated tilegap patch to dwm 6.4.
diff --git a/dwm.suckless.org/patches/tilegap/dwm-tilegap-6.4.diff b/dwm.suckless.org/patches/tilegap/dwm-tilegap-6.4.diff
new file mode 100644
index 00000000..155fa00c
--- /dev/null
+++ b/dwm.suckless.org/patches/tilegap/dwm-tilegap-6.4.diff
_AT_@ -0,0 +1,77 @@
+From e655302a4bd74c1f2778f94761c87381d1dfc0e2 Mon Sep 17 00:00:00 2001
+From: midspec <obleque_AT_protonmail.com>
+Date: Sat, 4 Nov 2023 19:17:50 +0000
+Subject: [PATCH] Add window-gaps for the tile-layout
+
+Adds gaps between windows in the tile-layout. The proposed advantage to some
+other patches which try to accomplish the same goal is that the gap-size between
+master and stack, window and window, and window and screen-edge is the
+same. The gap-size can be configured in the config.h with the
+gappx-variable.
+
+---
+ config.def.h | 1 +
+ dwm.c | 23 +++++++++++++----------
+ 2 files changed, 14 insertions(+), 10 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 9efa774..82ba41f 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -2,6 +2,7 @@
+
+ /* appearance */
+ static const unsigned int borderpx = 1; /* border pixel of windows */
++static const unsigned int gappx = 18; /* gap pixel between windows */
+ static const unsigned int snap = 32; /* snap pixel */
+ static const int showbar = 1; /* 0 means no bar */
+ static const int topbar = 1; /* 0 means bottom bar */
+diff --git a/dwm.c b/dwm.c
+index f1d86b2..fa8b3d6 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -1687,28 +1687,31 @@ tagmon(const Arg *arg)
+ void
+ tile(Monitor *m)
+ {
+- unsigned int i, n, h, mw, my, ty;
++ unsigned int i, n, h, mw, my, ty, ns;
+ Client *c;
+
+ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+ if (n == 0)
+ return;
+
+- if (n > m->nmaster)
++ if (n > m->nmaster) {
+ mw = m->nmaster ? m->ww * m->mfact : 0;
+- else
++ ns = m->nmaster > 0 ? 2 : 1;
++ } else {
+ mw = m->ww;
+- for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
++ ns = 1;
++ }
++ for(i = 0, my = ty = gappx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+ if (i < m->nmaster) {
+- h = (m->wh - my) / (MIN(n, m->nmaster) - i);
+- resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0);
++ h = (m->wh - my) / (MIN(n, m->nmaster) - i) - gappx;
++ resize(c, m->wx + gappx, m->wy + my, mw - (2*c->bw) - gappx*(5-ns)/2, h - (2*c->bw), False);
+ if (my + HEIGHT(c) < m->wh)
+- my += HEIGHT(c);
++ my += HEIGHT(c) + gappx;
+ } else {
+- h = (m->wh - ty) / (n - i);
+- resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0);
++ h = (m->wh - ty) / (n - i) - gappx;
++ resize(c, m->wx + mw + gappx/ns, m->wy + ty, m->ww - mw - (2*c->bw) - gappx*(5-ns)/2, h - (2*c->bw), False);
+ if (ty + HEIGHT(c) < m->wh)
+- ty += HEIGHT(c);
++ ty += HEIGHT(c) + gappx;
+ }
+ }
+
+--
+2.42.0
+
diff --git a/dwm.suckless.org/patches/tilegap/index.md b/dwm.suckless.org/patches/tilegap/index.md
index 57680ab3..cd35d830 100644
--- a/dwm.suckless.org/patches/tilegap/index.md
+++ b/dwm.suckless.org/patches/tilegap/index.md
_AT_@ -11,8 +11,10 @@ Download
--------
* [dwm-tilegap-6.0.diff](dwm-tilegap-6.0.diff) (948b) (20150707)
* [dwm-tilegap-6.2.diff](dwm-tilegap-6.2.diff) (20190227)
+* [dwm-tilegap-6.4.diff](dwm-tilegap-6.4.diff) (20231104)
Author
------
* Brandon Mulcahy - <brandon_AT_jangler.info>
* Aleksandrs Stier (6.2 port)
+* Midspec (6.4 port)
Received on Sat Nov 04 2023 - 23:02:00 CET
This archive was generated by hypermail 2.3.0
: Sat Nov 04 2023 - 23:12:57 CET