[wiki] [sites] dwm bottomstack patch: remove 6.0 and add keybindings || FRIGN

From: <git_AT_suckless.org>
Date: Tue, 19 Jul 2016 11:46:16 +0200

commit f3e7e3a9fd804a64d178f8918f07cb1deb31d728
Author: FRIGN <dev_AT_frign.de>
Date: Tue Jul 19 11:45:52 2016 +0200

    dwm bottomstack patch: remove 6.0 and add keybindings
    
    it should be easier to just apply and get started.

diff --git a/dwm.suckless.org/patches/bottomstack.md b/dwm.suckless.org/patches/bottomstack.md
index 8d00119..05e2a9f 100644
--- a/dwm.suckless.org/patches/bottomstack.md
+++ b/dwm.suckless.org/patches/bottomstack.md
_AT_@ -16,10 +16,11 @@ Description
         | | | | +-----------------+
         +-----+-----+-----+ +-----------------+
 
+`bstack` can be selected with [Alt]+[u], `bstackhoriz` with [Alt]+[o].
+
 Download
 --------
 
- * [dwm-bottomstack-6.0.diff](dwm-bottomstack-6.0.diff)
  * [dwm-bottomstack-6.1.diff](dwm-bottomstack-6.1.diff)
  * [dwm-bottomstack-20160719-56a31dc.diff](dwm-bottomstack-20160719-56a31dc.diff)
 
_AT_@ -27,4 +28,4 @@ Authors
 -------
 
  * Anselm R Garbe - <anselm_AT_garbe.us>
- * Laslo Hunhold - <dev_AT_frign.de> (6.0, 6.1, git ports)
+ * Laslo Hunhold - <dev_AT_frign.de> (6.1, git ports)
diff --git a/dwm.suckless.org/patches/dwm-bottomstack-20160719-56a31dc.diff b/dwm.suckless.org/patches/dwm-bottomstack-20160719-56a31dc.diff
index d63c2c2..d982817 100644
--- a/dwm.suckless.org/patches/dwm-bottomstack-20160719-56a31dc.diff
+++ b/dwm.suckless.org/patches/dwm-bottomstack-20160719-56a31dc.diff
_AT_@ -1,5 +1,5 @@
 diff --git a/config.def.h b/config.def.h
-index fd77a07..064179e 100644
+index fd77a07..c3a044b 100644
 --- a/config.def.h
 +++ b/config.def.h
 _AT_@ -41,6 +41,8 @@ static const Layout layouts[] = {
_AT_@ -11,6 +11,15 @@ index fd77a07..064179e 100644
  };
  
  /* key definitions */
+_AT_@ -76,6 +78,8 @@ 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_u, setlayout, {.v = &layouts[3]} },
++ { MODKEY, XK_o, setlayout, {.v = &layouts[4]} },
+ { 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 b2bc9bd..8b74165 100644
 --- a/dwm.c
diff --git a/dwm.suckless.org/patches/dwm-bottomstack-6.0.diff b/dwm.suckless.org/patches/dwm-bottomstack-6.0.diff
deleted file mode 100644
index 6915c04..0000000
--- a/dwm.suckless.org/patches/dwm-bottomstack-6.0.diff
+++ /dev/null
_AT_@ -1,92 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index 77ff358..e8ccff6 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -32,6 +32,8 @@ static const Layout layouts[] = {
- { "[]=", tile }, /* first entry is default */
- { "><>", NULL }, /* no layout function means floating behavior */
- { "[M]", monocle },
-+ { "TTT", bstack },
-+ { "===", bstackhoriz },
- };
-
- /* key definitions */
-diff --git a/dwm.c b/dwm.c
-index 1d78655..49d7fe8 100644
---- a/dwm.c
-+++ b/dwm.c
-_AT_@ -251,6 +251,8 @@ static int xerror(Display *dpy, XErrorEvent *ee);
- static int xerrordummy(Display *dpy, XErrorEvent *ee);
- static int xerrorstart(Display *dpy, XErrorEvent *ee);
- static void zoom(const Arg *arg);
-+static void bstack(Monitor *m);
-+static void bstackhoriz(Monitor *m);
-
- /* variables */
- static const char broken[] = "broken";
-_AT_@ -2144,3 +2146,65 @@ main(int argc, char *argv[]) {
- XCloseDisplay(dpy);
- return EXIT_SUCCESS;
- }
-+
-+static void
-+bstack(Monitor *m) {
-+ int w, h, mh, mx, tx, ty, tw;
-+ unsigned int i, n;
-+ Client *c;
-+
-+ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
-+ if (n == 0)
-+ return;
-+ if (n > m->nmaster) {
-+ mh = m->nmaster ? m->mfact * m->wh : 0;
-+ tw = m->ww / (n - m->nmaster);
-+ ty = m->wy + mh;
-+ } else {
-+ mh = m->wh;
-+ tw = m->ww;
-+ ty = m->wy;
-+ }
-+ for (i = mx = 0, tx = m->wx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
-+ if (i < m->nmaster) {
-+ w = (m->ww - mx) / (MIN(n, m->nmaster) - i);
-+ resize(c, m->wx + mx, m->wy, w - (2 * c->bw), mh - (2 * c->bw), 0);
-+ mx += WIDTH(c);
-+ } else {
-+ h = m->wh - mh;
-+ resize(c, tx, ty, tw - (2 * c->bw), h - (2 * c->bw), 0);
-+ if (tw != m->ww)
-+ tx += WIDTH(c);
-+ }
-+ }
-+}
-+
-+static void
-+bstackhoriz(Monitor *m) {
-+ int w, mh, mx, tx, ty, th;
-+ unsigned int i, n;
-+ Client *c;
-+
-+ for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
-+ if (n == 0)
-+ return;
-+ if (n > m->nmaster) {
-+ mh = m->nmaster ? m->mfact * m->wh : 0;
-+ th = (m->wh - mh) / (n - m->nmaster);
-+ ty = m->wy + mh;
-+ } else {
-+ th = mh = m->wh;
-+ ty = m->wy;
-+ }
-+ for (i = mx = 0, tx = m->wx, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
-+ if (i < m->nmaster) {
-+ w = (m->ww - mx) / (MIN(n, m->nmaster) - i);
-+ resize(c, m->wx + mx, m->wy, w - (2 * c->bw), mh - (2 * c->bw), 0);
-+ mx += WIDTH(c);
-+ } else {
-+ resize(c, tx, ty, m->ww - (2 * c->bw), th - (2 * c->bw), 0);
-+ if (th != m->wh)
-+ ty += HEIGHT(c);
-+ }
-+ }
-+}
diff --git a/dwm.suckless.org/patches/dwm-bottomstack-6.1.diff b/dwm.suckless.org/patches/dwm-bottomstack-6.1.diff
index 8958a98..9fdffd5 100644
--- a/dwm.suckless.org/patches/dwm-bottomstack-6.1.diff
+++ b/dwm.suckless.org/patches/dwm-bottomstack-6.1.diff
_AT_@ -1,5 +1,5 @@
 diff --git a/config.def.h b/config.def.h
-index 7054c06..4111c1d 100644
+index 7054c06..554f1db 100644
 --- a/config.def.h
 +++ b/config.def.h
 _AT_@ -39,6 +39,8 @@ static const Layout layouts[] = {
_AT_@ -11,6 +11,15 @@ index 7054c06..4111c1d 100644
  };
  
  /* key definitions */
+_AT_@ -74,6 +76,8 @@ 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_u, setlayout, {.v = &layouts[3]} },
++ { MODKEY, XK_o, setlayout, {.v = &layouts[4]} },
+ { 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 0362114..c313b5e 100644
 --- a/dwm.c
Received on Tue Jul 19 2016 - 11:46:16 CEST

This archive was generated by hypermail 2.3.0 : Tue Jul 19 2016 - 11:48:17 CEST