[wiki] [sites] Added the horizgrid patch for dwm || Marshall Mason

From: <git_AT_suckless.org>
Date: Sat, 09 Jan 2016 08:59:43 +0100

commit e8b6d9892ac09a1753c0f1a94110f84df53b1c1d
Author: Marshall Mason <marshallmason3_AT_gmail.com>
Date: Fri Jan 8 23:58:45 2016 -0800

    Added the horizgrid patch for dwm

diff --git a/dwm.suckless.org/patches/dwm-6.1-horizgrid.diff b/dwm.suckless.org/patches/dwm-6.1-horizgrid.diff
new file mode 100644
index 0000000..0920cee
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-6.1-horizgrid.diff
_AT_@ -0,0 +1,70 @@
+From 064e1d48631cd9b03f32b42d7be79677197ee42f Mon Sep 17 00:00:00 2001
+From: Marshall Mason <marshallmason3_AT_gmail.com>
+Date: Mon, 9 Nov 2015 12:38:28 -0800
+Subject: [PATCH] Added horizgrid function
+
+---
+ config.def.h | 2 ++
+ horizgrid.c | 32 ++++++++++++++++++++++++++++++++
+ 2 files changed, 34 insertions(+)
+ create mode 100644 horizgrid.c
+
+diff --git a/config.def.h b/config.def.h
+index eaae8f3..c2ad519 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -36,11 +36,13 @@ static const float mfact = 0.55; /* factor of master area size [0.05..0.95]
+ static const int nmaster = 1; /* number of clients in master area */
+ static const Bool resizehints = True; /* True means respect size hints in tiled resizals */
+
++#include "horizgrid.c"
+ static const Layout layouts[] = {
+ /* symbol arrange function */
+ { "[]=", tile }, /* first entry is default */
+ { "><>", NULL }, /* no layout function means floating behavior */
+ { "[M]", monocle },
++ { "###", horizgrid },
+ };
+
+ /* key definitions */
+diff --git a/horizgrid.c b/horizgrid.c
+new file mode 100644
+index 0000000..51ce0f8
+--- /dev/null
++++ b/horizgrid.c
+_AT_@ -0,0 +1,32 @@
++void
++horizgrid(Monitor *m) {
++ Client *c;
++ unsigned int n, i;
++ int w = 0;
++ int ntop, nbottom = 0;
++
++ /* Count windows */
++ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
++
++ if(n == 0)
++ return;
++ else if(n == 1) { /* Just fill the whole screen */
++ c = nexttiled(m->clients);
++ resize(c, m->wx, m->wy, m->ww - (2*c->bw), m->wh - (2*c->bw), False);
++ } else if(n == 2) { /* Split vertically */
++ w = m->ww / 2;
++ c = nexttiled(m->clients);
++ resize(c, m->wx, m->wy, w - (2*c->bw), m->wh - (2*c->bw), False);
++ c = nexttiled(c->next);
++ resize(c, m->wx + w, m->wy, w - (2*c->bw), m->wh - (2*c->bw), False);
++ } else {
++ ntop = n / 2;
++ nbottom = n - ntop;
++ for(i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
++ if(i < ntop)
++ resize(c, m->wx + i * m->ww / ntop, m->wy, m->ww / ntop - (2*c->bw), m->wh / 2 - (2*c->bw), False);
++ else
++ resize(c, m->wx + (i - ntop) * m->ww / nbottom, m->wy + m->wh / 2, m->ww / nbottom - (2*c->bw), m->wh / 2 - (2*c->bw), False);
++ }
++ }
++}
+--
+2.1.4
+
diff --git a/dwm.suckless.org/patches/horizgrid.md b/dwm.suckless.org/patches/horizgrid.md
new file mode 100644
index 0000000..1c3a46f
--- /dev/null
+++ b/dwm.suckless.org/patches/horizgrid.md
_AT_@ -0,0 +1,37 @@
+horizontal grid
+===============
+
+Description
+-----------
+This patch is a variant of [gapless_grid](gapless_grid). It arranges windows in a grid pattern in which every window is roughly the same size, adjusted such that there are no gaps. However, this layout arranges the windows in a horizontal grid, rather than a vertical grid.
+
+Horizontal Grid Layout
+----------------------
+
+ horizgrid (###)
+ +--------+--------+
+ | | |
+ | | |
+ +-----+--+--+-----+
+ | | | |
+ | | | |
+ +-----+-----+-----+
+
+ gapless_grid
+ +--------+--------+
+ | | |
+ | +--------+
+ +--------+ |
+ | +--------+
+ | | |
+ +--------+--------+
+
+Download
+--------
+
+ * [dwm-6.1-horizgrid.diff](dwm-6.1-horizgrid.diff) (20160108)
+
+Authors
+-------
+
+ * Marshall Mason - `<marshallmason2_AT_gmail.com>`
Received on Sat Jan 09 2016 - 08:59:43 CET

This archive was generated by hypermail 2.3.0 : Sat Jan 09 2016 - 09:00:16 CET