[wiki] [sites] [dwm][deck] Simplify by removing layouts.c || aleks

From: <git_AT_suckless.org>
Date: Sat, 04 May 2019 22:09:40 +0200

commit c8d99f5f13e4a9c3f0cde0e1191b5f9d4f494dd0
Author: aleks <aleks.stier_AT_icloud.com>
Date: Sat May 4 21:57:28 2019 +0200

    [dwm][deck] Simplify by removing layouts.c
    
    dwm-deck-20170909-ceac8c9.diff creates a layouts.c file with the
    deck-function. This commit adds dwm-deck-6.2.diff which simplifies it
    by removing layouts.c and merging the deck-function into dwm.c

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..8ad81a16
--- /dev/null
+++ b/dwm.suckless.org/patches/deck/dwm-deck-6.2.diff
_AT_@ -0,0 +1,84 @@
+From 5a61a7c9152019d7097ad5af7300a6f83e053978 Mon Sep 17 00:00:00 2001
+From: aleks <aleks.stier_AT_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
+_AT_@ -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 */
+_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..59d4ddb 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -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);
+_AT_@ -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
index b6baa9e9..e3085e04 100644
--- a/dwm.suckless.org/patches/deck/index.md
+++ b/dwm.suckless.org/patches/deck/index.md
_AT_@ -3,10 +3,10 @@ deck layout
 
 Description
 -----------
-`deck` is a new layout for DWM (inspired by the TTWM window manager). It is
-like tile(), but with monocle in the stack. You have a master client (complete
-with nmaster et all), but the stack clients now overlap one another as in
-monocle(). (The stacked clients are like a deck of cards, hence the name).
+`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.
 
         Tile :
         +-----------------+--------+
_AT_@ -32,9 +32,11 @@ monocle(). (The stacked clients are like a deck of cards, hence the name).
 
 Download
 --------
-* [dwm-deck-6.0.diff](dwm-deck-6.0.diff)
+* [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)
Received on Sat May 04 2019 - 22:09:40 CEST

This archive was generated by hypermail 2.3.0 : Sat May 04 2019 - 22:12:26 CEST