[wiki] [sites] Add patch to support horizontal tiling similar to i3 and other commonly-used WMs. || Forrest Bushstone

From: <git_AT_suckless.org>
Date: Thu, 14 Sep 2023 01:52:26 +0200

commit 8cb170e693843734c62b7d70d47236cf2bfbd4b4
Author: Forrest Bushstone <fgb.1_AT_protonmail.com>
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
_AT_@ -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
+_AT_@ -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
+_AT_@ -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);
+_AT_@ -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
_AT_@ -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- `<fgb.1_AT_protonmail.com>`
Received on Thu Sep 14 2023 - 01:52:26 CEST

This archive was generated by hypermail 2.3.0 : Thu Sep 14 2023 - 02:01:09 CEST