dwm-deck-6.2.diff - sites - public wiki contents of suckless.org | |
git clone git://git.suckless.org/sites | |
Log | |
Files | |
Refs | |
--- | |
dwm-deck-6.2.diff (2438B) | |
--- | |
1 From a071b060a1b9b94bcb167b988cf7774ceb870aad Mon Sep 17 00:00:00 2001 | |
2 From: Jack Bird <[email protected]> | |
3 Date: Mon, 2 Aug 2021 18:44:05 +0100 | |
4 Subject: [PATCH] deck patch works with 6.2 | |
5 | |
6 --- | |
7 config.def.h | 2 ++ | |
8 dwm.c | 26 ++++++++++++++++++++++++++ | |
9 2 files changed, 28 insertions(+) | |
10 | |
11 diff --git a/config.def.h b/config.def.h | |
12 index a2ac963..d865e18 100644 | |
13 --- a/config.def.h | |
14 +++ b/config.def.h | |
15 @@ -42,6 +42,7 @@ static const Layout layouts[] = { | |
16 { "[]=", tile }, /* first entry is default */ | |
17 { "><>", NULL }, /* no layout function means floating b… | |
18 { "[M]", monocle }, | |
19 + { "[D]", deck }, | |
20 }; | |
21 | |
22 /* key definitions */ | |
23 @@ -77,6 +78,7 @@ static Key keys[] = { | |
24 { MODKEY, XK_t, setlayout, {.v … | |
25 { MODKEY, XK_f, setlayout, {.v … | |
26 { MODKEY, XK_m, setlayout, {.v … | |
27 + { MODKEY, XK_r, setlayout, {.v … | |
28 { MODKEY, XK_space, setlayout, {0} … | |
29 { MODKEY|ShiftMask, XK_space, togglefloating, {0} … | |
30 { MODKEY, XK_0, view, {.ui… | |
31 diff --git a/dwm.c b/dwm.c | |
32 index 5e4d494..c67ff91 100644 | |
33 --- a/dwm.c | |
34 +++ b/dwm.c | |
35 @@ -157,6 +157,7 @@ static void configure(Client *c); | |
36 static void configurenotify(XEvent *e); | |
37 static void configurerequest(XEvent *e); | |
38 static Monitor *createmon(void); | |
39 +static void deck(Monitor *m); | |
40 static void destroynotify(XEvent *e); | |
41 static void detach(Client *c); | |
42 static void detachstack(Client *c); | |
43 @@ -655,6 +656,31 @@ destroynotify(XEvent *e) | |
44 unmanage(c, 1); | |
45 } | |
46 | |
47 +void | |
48 +deck(Monitor *m) { | |
49 + unsigned int i, n, h, mw, my; | |
50 + Client *c; | |
51 + | |
52 + for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next)… | |
53 + if(n == 0) | |
54 + return; | |
55 + | |
56 + if(n > m->nmaster) { | |
57 + mw = m->nmaster ? m->ww * m->mfact : 0; | |
58 + snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n - m… | |
59 + } | |
60 + else | |
61 + mw = m->ww; | |
62 + for(i = my = 0, c = nexttiled(m->clients); c; c = nexttiled(c->… | |
63 + if(i < m->nmaster) { | |
64 + h = (m->wh - my) / (MIN(n, m->nmaster) - i); | |
65 + resize(c, m->wx, m->wy + my, mw - (2*c->bw), h … | |
66 + my += HEIGHT(c); | |
67 + } | |
68 + else | |
69 + resize(c, m->wx + mw, m->wy, m->ww - mw - (2*c-… | |
70 +} | |
71 + | |
72 void | |
73 detach(Client *c) | |
74 { | |
75 -- | |
76 2.32.0 | |
77 |