commit 8cb170e693843734c62b7d70d47236cf2bfbd4b4
Author: Forrest Bushstone <[email protected]>
Date:   Wed Sep 13 19:50:27 2023 -0400

    Add patch to support horizontal tiling similar to i3 and other
    commonly-used WMs.

diff --git a/dwm.suckless.org/patches/horizontal/dwm-horizontal-6.4.diff 
b/dwm.suckless.org/patches/horizontal/dwm-horizontal-6.4.diff
new file mode 100644
index 00000000..a0b1c56e
--- /dev/null
+++ b/dwm.suckless.org/patches/horizontal/dwm-horizontal-6.4.diff
@@ -0,0 +1,47 @@
+diff --git a/config.def.h b/config.def.h
+index 9efa774..24d44e0 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -39,6 +39,7 @@ static const int lockfullscreen = 1; /* 1 will force focus 
on the fullscreen win
+ 
+ static const Layout layouts[] = {
+       /* symbol     arrange function */
++      { "III",      horizontal },
+       { "[]=",      tile },    /* first entry is default */
+       { "><>",      NULL },    /* no layout function means floating behavior 
*/
+       { "[M]",      monocle },
+diff --git a/dwm.c b/dwm.c
+index f1d86b2..9a188d9 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -175,6 +175,7 @@ static long getstate(Window w);
+ static int gettextprop(Window w, Atom atom, char *text, unsigned int size);
+ static void grabbuttons(Client *c, int focused);
+ static void grabkeys(void);
++static void horizontal(Monitor *m);
+ static void incnmaster(const Arg *arg);
+ static void keypress(XEvent *e);
+ static void killclient(const Arg *arg);
+@@ -977,6 +978,22 @@ grabkeys(void)
+       }
+ }
+ 
++void
++horizontal(Monitor *m)
++{
++      Client *c;
++      unsigned int n, i;
++
++      /* Count windows */
++      for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
++
++      if(!n)
++              return;
++      else /* Split vertically */
++              for(i = 0, c = nexttiled(m->clients); c; c = 
nexttiled(c->next), i++)
++                      resize(c, m->wx + i * m->mw / n, m->wy, m->mw / n - (2 
* c->bw), m->wh - (2 * c->bw), False);
++}
++
+ void
+ incnmaster(const Arg *arg)
+ {
diff --git a/dwm.suckless.org/patches/horizontal/index.md 
b/dwm.suckless.org/patches/horizontal/index.md
new file mode 100644
index 00000000..48b3e8ec
--- /dev/null
+++ b/dwm.suckless.org/patches/horizontal/index.md
@@ -0,0 +1,30 @@
+horizontal
+===============
+
+Description
+-----------
+This patch provides a horizontal layout similar to many other window managers.
+The width of each window is the width of the monitor divided by the number of
+windows on the screen.
+
+Currently, there is an issue with many GTK-based programs where having more 
than
+three windows open on a tag causes the windows to overlap.
+
+Horizontal Layout
+----------------------
+       horizontal    (III)
+       +-----+-----+-----+
+       |     |     |     |
+       |     |     |     |
+       |     |     |     |
+       |     |     |     |
+       |     |     |     |
+       +-----+-----+-----+
+
+Download
+--------
+* [dwm-horizontal-6.4.diff](dwm-horizontal-6.4.diff) (20230913)
+
+Authors
+-------
+* Forrest Bushstone- `<[email protected]>`


Reply via email to