[wiki] [sites] [dwm][patch][deck] Updated patch to apply on 6.2 || Jack Bird
commit 41750d0099b6ba2659ea3b594d2249c7558f4562
Author: Jack Bird <jack.bird_AT_durham.ac.uk>
Date: Mon Aug 16 00:58:03 2021 +0100
[dwm][patch][deck] Updated patch to apply on 6.2
diff --git a/dwm.suckless.org/patches/deck/dwm-deck-6.2.diff b/dwm.suckless.org/patches/deck/dwm-deck-6.2.diff
new file mode 100644
index 00000000..b5afed73
--- /dev/null
+++ b/dwm.suckless.org/patches/deck/dwm-deck-6.2.diff
_AT_@ -0,0 +1,77 @@
+From a071b060a1b9b94bcb167b988cf7774ceb870aad Mon Sep 17 00:00:00 2001
+From: Jack Bird <jack.bird_AT_durham.ac.uk>
+Date: Mon, 2 Aug 2021 18:44:05 +0100
+Subject: [PATCH] deck patch works with 6.2
+
+---
+ config.def.h | 2 ++
+ dwm.c | 26 ++++++++++++++++++++++++++
+ 2 files changed, 28 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index a2ac963..d865e18 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -42,6 +42,7 @@ static const Layout layouts[] = {
+ { "[]=", tile }, /* first entry is default */
+ { "><>", NULL }, /* no layout function means floating behavior */
+ { "[M]", monocle },
++ { "[D]", deck },
+ };
+
+ /* key definitions */
+_AT_@ -77,6 +78,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_r, 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 5e4d494..c67ff91 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -157,6 +157,7 @@ static void configure(Client *c);
+ static void configurenotify(XEvent *e);
+ static void configurerequest(XEvent *e);
+ static Monitor *createmon(void);
++static void deck(Monitor *m);
+ static void destroynotify(XEvent *e);
+ static void detach(Client *c);
+ static void detachstack(Client *c);
+_AT_@ -655,6 +656,31 @@ destroynotify(XEvent *e)
+ unmanage(c, 1);
+ }
+
++void
++deck(Monitor *m) {
++ unsigned int i, n, h, mw, my;
++ 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;
++ snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n - m->nmaster);
++ }
++ else
++ mw = m->ww;
++ for(i = my = 0, 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), False);
++ my += HEIGHT(c);
++ }
++ else
++ resize(c, m->wx + mw, m->wy, m->ww - mw - (2*c->bw), m->wh - (2*c->bw), False);
++}
++
+ void
+ detach(Client *c)
+ {
+--
+2.32.0
+
diff --git a/dwm.suckless.org/patches/deck/index.md b/dwm.suckless.org/patches/deck/index.md
index 4b17f54e..2fee64b5 100644
--- a/dwm.suckless.org/patches/deck/index.md
+++ b/dwm.suckless.org/patches/deck/index.md
_AT_@ -56,6 +56,7 @@ Showcase
Download
--------
* [dwm-deck-6.0.diff](dwm-deck-6.0.diff)
+* [dwm-deck-6.2.diff](dwm-deck-6.2.diff)
* [dwm-deck-rmaster-6.1.diff](dwm-deck-rmaster-6.1.diff)
* [dwm-deck-tilegap-6.1.diff](dwm-deck-tilegap-6.1.diff)
* [dwm-deck-double-6.2.diff](dwm-deck-double-6.2.diff)
_AT_@ -67,3 +68,4 @@ Author
* Joshua Haase - `<hahj87 at gmail dot com>`
* Aleksandrs Stier
* Miles Alan - `<m at milesalan dot com>` (deck double patch)
+* Jack Bird - `<jack.bird_AT_dur.ac.uk>` (6.2 patch)
Received on Mon Aug 16 2021 - 01:58:53 CEST
This archive was generated by hypermail 2.3.0
: Mon Aug 16 2021 - 02:00:44 CEST