commit 4f1d31ec4c37bd82bd80c772ffc55f8ec872b0cf
parent 857ede1424df883625c7313789415c39c158030f
Author: aleks <aleks.stier@icloud.com>
Date: Mon, 6 May 2019 15:09:52 +0200
[dwm][deck] Merge multiple patch-versions into one
Merge the original dwm-deck-6.0 patch with the improved
dwm-deck-20170909-ceac8c9 patch and the simplified dwm-deck-6.2 patch.
Some additional simplifications are made.
Diffstat:
4 files changed, 57 insertions(+), 180 deletions(-)
diff --git a/dwm.suckless.org/patches/deck/dwm-deck-20170909-ceac8c9.diff b/dwm.suckless.org/patches/deck/dwm-deck-20170909-ceac8c9.diff
@@ -1,75 +0,0 @@
-From c1b5c188abe327751f9abce367acc1e7be727514 Mon Sep 17 00:00:00 2001
-From: Joshua Haase <hahj87@gmail.com>
-Date: Tue, 16 Aug 2016 10:00:05 -0500
-Subject: [PATCH] Apply a modified deck patch.
-
----
- config.def.h | 3 +++
- layouts.c | 29 +++++++++++++++++++++++++++++
- 2 files changed, 32 insertions(+)
- create mode 100644 layouts.c
-
-diff --git a/config.def.h b/config.def.h
-index a9ac303..37ec7f3 100644
---- a/config.def.h
-+++ b/config.def.h
-@@ -36,11 +36,13 @@ static const float mfact = 0.55; /* factor of master area size [0.05..0.95]
- static const int nmaster = 1; /* number of clients in master area */
- static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
-
-+#include "layouts.c"
- static const Layout layouts[] = {
- /* symbol arrange function */
- { "[]=", tile }, /* first entry is default */
- { "><>", NULL }, /* no layout function means floating behavior */
- { "[M]", monocle },
-+ { "H[]", deck },
- };
-
- /* key definitions */
-@@ -76,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_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/layouts.c b/layouts.c
-new file mode 100644
-index 0000000..e2c17f2
---- /dev/null
-+++ b/layouts.c
-@@ -0,0 +1,29 @@
-+static void deck(Monitor *m);
-+
-+void
-+deck(Monitor *m) {
-+ int dn;
-+ 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;
-+
-+ dn = n - m->nmaster;
-+ if(dn > 0) /* override layout symbol */
-+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "D %d", dn);
-+
-+ if(n > m->nmaster)
-+ mw = m->nmaster ? m->ww * m->mfact : 0;
-+ 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);
-+}
---
-2.14.1
-
diff --git a/dwm.suckless.org/patches/deck/dwm-deck-6.0.diff b/dwm.suckless.org/patches/deck/dwm-deck-6.0.diff
@@ -1,19 +1,55 @@
---- dwm.c.orig 2013-03-26 23:50:10.044576455 +0100
-+++ dwm.c 2013-03-26 23:50:27.494576161 +0100
-@@ -171,6 +171,7 @@
- static void configurenotify(XEvent *e);
+From b9bbda20e4ef34f603485e43d1f3664020845122 Mon Sep 17 00:00:00 2001
+From: aleks <aleks.stier@icloud.com>
+Date: Mon, 6 May 2019 14:49:20 +0200
+Subject: [PATCH] Add deck-layout
+
+deck is a dwm-layout which is inspired by the TTWM window manager.
+It applies the monocle-layout to the clients in the stack.
+The master-client is still visible. The stacked clients are like
+a deck of cards, hence the name.
+---
+ config.def.h | 2 ++
+ dwm.c | 26 ++++++++++++++++++++++++++
+ 2 files changed, 28 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index 77ff358..55d8a07 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -32,6 +32,7 @@ static const Layout layouts[] = {
+ { "[]=", tile }, /* first entry is default */
+ { "><>", NULL }, /* no layout function means floating behavior */
+ { "[M]", monocle },
++ { "[D]", deck },
+ };
+
+ /* key definitions */
+@@ -66,6 +67,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 1d78655..d699a7f 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -172,6 +172,7 @@ 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 deck(Monitor *m);
static void detach(Client *c);
static void detachstack(Client *c);
-@@ -661,6 +662,34 @@
+ static void die(const char *errstr, ...);
+@@ -669,6 +670,31 @@ destroynotify(XEvent *e) {
+ unmanage(c, True);
}
- void
++void
+deck(Monitor *m) {
-+ int dn;
+ unsigned int i, n, h, mw, my;
+ Client *c;
+
@@ -21,12 +57,10 @@
+ if(n == 0)
+ return;
+
-+ dn = n - m->nmaster;
-+ if(dn > 0) /* override layout symbol */
-+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "D %d", dn);
-+
-+ if(n > m->nmaster)
++ 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++)
@@ -39,7 +73,9 @@
+ resize(c, m->wx + mw, m->wy, m->ww - mw - (2*c->bw), m->wh - (2*c->bw), False);
+}
+
-+void
- destroynotify(XEvent *e) {
- Client *c;
- XDestroyWindowEvent *ev = &e->xdestroywindow;
+ void
+ detach(Client *c) {
+ Client **tc;
+--
+2.21.0
+
diff --git a/dwm.suckless.org/patches/deck/dwm-deck-6.2.diff b/dwm.suckless.org/patches/deck/dwm-deck-6.2.diff
@@ -1,84 +0,0 @@
-From 5a61a7c9152019d7097ad5af7300a6f83e053978 Mon Sep 17 00:00:00 2001
-From: aleks <aleks.stier@icloud.com>
-Date: Sat, 4 May 2019 21:15:25 +0200
-Subject: [PATCH] Add deck-layout
-
-deck is a dwm-layout which is inspired by the TTWM window manager.
-It applies the monocle-layout only to the clients in the stack.
-The master-client is still visible. The stacked clients are like
-a deck of cards, hence the name.
----
- config.def.h | 2 ++
- dwm.c | 29 +++++++++++++++++++++++++++++
- 2 files changed, 31 insertions(+)
-
-diff --git a/config.def.h b/config.def.h
-index 1c0b587..f480546 100644
---- a/config.def.h
-+++ b/config.def.h
-@@ -41,6 +41,7 @@ static const Layout layouts[] = {
- { "[]=", tile }, /* first entry is default */
- { "><>", NULL }, /* no layout function means floating behavior */
- { "[M]", monocle },
-+ { "H[]", deck },
- };
-
- /* key definitions */
-@@ -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..59d4ddb 100644
---- a/dwm.c
-+++ b/dwm.c
-@@ -158,6 +158,7 @@ static void configurenotify(XEvent *e);
- static void configurerequest(XEvent *e);
- static Monitor *createmon(void);
- static void destroynotify(XEvent *e);
-+static void deck(Monitor *m);
- static void detach(Client *c);
- static void detachstack(Client *c);
- static Monitor *dirtomon(int dir);
-@@ -654,6 +655,34 @@ destroynotify(XEvent *e)
- unmanage(c, 1);
- }
-
-+void
-+deck(Monitor *m) {
-+ int dn;
-+ 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;
-+
-+ dn = n - m->nmaster;
-+ if(dn > 0) /* override layout symbol */
-+ snprintf(m->ltsymbol, sizeof m->ltsymbol, "D %d", dn);
-+
-+ if(n > m->nmaster)
-+ mw = m->nmaster ? m->ww * m->mfact : 0;
-+ 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.21.0
-
diff --git a/dwm.suckless.org/patches/deck/index.md b/dwm.suckless.org/patches/deck/index.md
@@ -4,11 +4,12 @@ deck layout
Description
-----------
`deck` is a dwm-layout which is inspired by the TTWM window manager.
-It applies the monocle-layout only to the clients in the stack.
+It applies the monocle-layout to the clients in the stack.
The master-client is still visible. The stacked clients are like
a deck of cards, hence the name.
NOTE: Doesn't respect patches which add gaps (ex. tilegap).
+This means that when the deck-layout is activated gaps are omitted.
Tile :
+-----------------+--------+
@@ -34,11 +35,10 @@ NOTE: Doesn't respect patches which add gaps (ex. tilegap).
Download
--------
-* [dwm-deck-6.2.diff](dwm-deck-6.2.diff)
-* [dwm-deck-20170909-ceac8c9.diff](dwm-deck-20170909-ceac8c9.diff)
* [dwm-deck-6.0.diff](dwm-deck-6.0.diff)
Author
------
* Jente Hidskes - `<jthidskes at outlook dot com>`
-* Aleksandrs Stier (6.2)
+* Joshua Haase - `<hahj87 at gmail dot com>`
+* Aleksandrs Stier