[wiki] [sites] [dwm][patches][columns] add 6.2 port || Louis Bettens
commit d34d6f172175e2179b28891792776897e2c50fa6
Author: Louis Bettens <louis_AT_bettens.info>
Date: Sun Dec 19 22:31:35 2021 +0100
[dwm][patches][columns] add 6.2 port
original patch does not apply on top of 6.0 because of code style changes
diff --git a/dwm.suckless.org/patches/columns/dwm-columns-6.2.diff b/dwm.suckless.org/patches/columns/dwm-columns-6.2.diff
new file mode 100644
index 00000000..33dedd47
--- /dev/null
+++ b/dwm.suckless.org/patches/columns/dwm-columns-6.2.diff
_AT_@ -0,0 +1,86 @@
+From 8394c430458713aa14dd8afdf86a9b14c646a1e7 Mon Sep 17 00:00:00 2001
+From: Louis Bettens <louis_AT_bettens.info>
+Date: Thu, 2 Dec 2021 21:41:07 +0100
+Subject: [PATCH] columns
+
+This patch adds an extra layout to dwm called `col` in which the windows in the
+master area are arranged in colums of equal size. The number of columns is
+always nmaster + 1, and the last column is a stack of leftover windows just
+like the normal tile layout. It effectively acts like the default tiling mode,
+except provides for vertical instead of horizontal master windows.
+
+Co-authored-by: Evan Gates (emg) <evan.gates_AT_gmail.com>
+Co-authored-by: Noah Rosser <noah.rosser_AT_gmail.com>
+---
+ config.def.h | 2 ++
+ dwm.c | 27 +++++++++++++++++++++++++++
+ 2 files changed, 29 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index 1c0b587..de7a2e7 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -41,6 +41,7 @@ static const Layout layouts[] = {
+ { "[]=", tile }, /* first entry is default */
+ { "><>", NULL }, /* no layout function means floating behavior */
+ { "[M]", monocle },
++ { "|||", col },
+ };
+
+ /* key definitions */
+_AT_@ -76,6 +77,7 @@ static Key keys[] = {
+ { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
+ { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
+ { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
++ { MODKEY, XK_c, setlayout, {.v = &layouts[3]} },
+ { MODKEY, XK_space, setlayout, {0} },
+ { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
+ { MODKEY, XK_0, view, {.ui = ~0 } },
+diff --git a/dwm.c b/dwm.c
+index 4465af1..b5845c9 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -153,6 +153,7 @@ static void checkotherwm(void);
+ static void cleanup(void);
+ static void cleanupmon(Monitor *mon);
+ static void clientmessage(XEvent *e);
++static void col(Monitor *);
+ static void configure(Client *c);
+ static void configurenotify(XEvent *e);
+ static void configurerequest(XEvent *e);
+_AT_@ -1670,6 +1671,32 @@ tagmon(const Arg *arg)
+ sendmon(selmon->sel, dirtomon(arg->i));
+ }
+
++void
++col(Monitor *m)
++{
++ unsigned int i, n, h, w, x, y, mw;
++ Client *c;
++
++ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
++ if (n == 0)
++ return;
++
++ if (n > m->nmaster)
++ mw = m->nmaster ? m->ww * m->mfact : 0;
++ else
++ mw = m->ww;
++ for (i = x = y = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
++ if (i < m->nmaster) {
++ w = (mw - x) / (MIN(n, m->nmaster) - i);
++ resize(c, x + m->wx, m->wy, w - (2 * c->bw), m->wh - (2 * c->bw), 0);
++ x += WIDTH(c);
++ } else {
++ h = (m->wh - y) / (n - i);
++ resize(c, x + m->wx, m->wy + y, m->ww - x - (2 * c->bw), h - (2 * c->bw), 0);
++ y += HEIGHT(c);
++ }
++}
++
+ void
+ tile(Monitor *m)
+ {
+--
+2.34.0
+
diff --git a/dwm.suckless.org/patches/columns/index.md b/dwm.suckless.org/patches/columns/index.md
index 04028b91..6fbab42f 100644
--- a/dwm.suckless.org/patches/columns/index.md
+++ b/dwm.suckless.org/patches/columns/index.md
_AT_@ -12,8 +12,10 @@ except provides for vertical instead of horizontal master windows.
Download
--------
* [dwm-columns-6.0.diff](dwm-columns-6.0.diff)
+* [dwm-columns-6.2.diff](dwm-columns-6.2.diff)
Author
------
* Evan Gates (emg)<evan.gates_AT_gmail.com>
* Noah Rosser <noah.rosser_AT_gmail.com>
+* Louis Bettens <louis_AT_bettens.info> (6.2 port)
Received on Sun Dec 19 2021 - 22:37:12 CET
This archive was generated by hypermail 2.3.0
: Sun Dec 19 2021 - 22:48:42 CET