[wiki] [sites] [dwm][tilegap] Port to 6.2 || astier

From: <git_AT_suckless.org>
Date: Wed, 27 Feb 2019 14:03:40 +0100

commit 5a31f51d4a44724db64a74963c29ca812240dedd
Author: astier <aleksandrs.stier_AT_uni-bielefeld.de>
Date: Wed Feb 27 13:51:56 2019 +0100

    [dwm][tilegap] Port to 6.2
    
    The current version dwm-tilegap-6.0 can't be applied to dwm-6.2 due to
    a failing hunk. It's essentially because some lines are shifted.
    This commit adds a fixed version dwm-tilegap-6.2

diff --git a/dwm.suckless.org/patches/tilegap/dwm-tilegap-6.2.diff b/dwm.suckless.org/patches/tilegap/dwm-tilegap-6.2.diff
new file mode 100644
index 00000000..e2c18960
--- /dev/null
+++ b/dwm.suckless.org/patches/tilegap/dwm-tilegap-6.2.diff
_AT_@ -0,0 +1,73 @@
+From dfea960240ed45a660abc1acba2041318127761f Mon Sep 17 00:00:00 2001
+From: astier <aleksandrs.stier_AT_uni-bielefeld.de>
+Date: Thu, 21 Feb 2019 09:38:38 +0100
+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 1c0b587..2ca9e56 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 4465af1..c556a2d 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -1673,26 +1673,29 @@ 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);
+- my += HEIGHT(c);
++ 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);
++ 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);
+- ty += HEIGHT(c);
++ 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);
++ ty += HEIGHT(c) + gappx;
+ }
+ }
+
+--
+2.20.1
diff --git a/dwm.suckless.org/patches/tilegap/index.md b/dwm.suckless.org/patches/tilegap/index.md
index cebd5368..fae6672f 100644
--- a/dwm.suckless.org/patches/tilegap/index.md
+++ b/dwm.suckless.org/patches/tilegap/index.md
_AT_@ -10,7 +10,12 @@ edge. Size configurable in config.h.
 Download
 --------
 * [dwm-tilegap-6.0.diff](dwm-tilegap-6.0.diff) (948b) (20150707)
+* [dwm-tilegap-6.2.diff](dwm-tilegap-6.2.diff) (20190227)
 
 Author
 ------
 * Brandon Mulcahy - <brandon_AT_jangler.info>
+
+Contributors
+------------
+* Aleksandrs Stier - <aleks.stier_AT_icloud.com> (6.2)
Received on Wed Feb 27 2019 - 14:03:40 CET

This archive was generated by hypermail 2.3.0 : Wed Feb 27 2019 - 14:12:27 CET