changeset: 222:bd1cd641f2a7
tag: tip
user: nsz_AT_tpx
date: Tue Sep 08 16:55:54 2009 +0200
files: dwm.suckless.org/patches/bottom_stack.md dwm.suckless.org/patches/bstack.c dwm.suckless.org/patches/bstackhoriz.c dwm.suckless.org/patches/dwm-5.2-gaplessgrid.diff dwm.suckless.org/patches/dwm-r1437-gaplessgrid.diff dwm.suckless.org/patches/gapless_grid.md dwm.suckless.org/patches/gaplessgrid.c dwm.suckless.org/patches/historical/bottom_stack.md dwm.suckless.org/patches/historical/dwm-5.2-gaplessgrid.diff dwm.suckless.org/patches/historical/dwm-r1437-gaplessgrid.diff dwm.suckless.org/patches/historical/gapless_grid.md dwm.suckless.org/patches/historical/nmaster+bstack-5.6.1.diff dwm.suckless.org/patches/historical/nmaster.md dwm.suckless.org/patches/historical/push-5.3.c dwm.suckless.org/patches/historical/push-5.6.c dwm.suckless.org/patches/historical/push.md dwm.suckless.org/patches/nmaster+bstack-5.6.1.diff dwm.suckless.org/patches/nmaster.c dwm.suckless.org/patches/nmaster.md dwm.suckless.org/patches/push-5.3.c dwm.suckless.org/patches/push-5.6.c dwm.suckless.org/patches/push.c dwm.suckless.
org/patches/push.md
description:
updated several patches, moved the old versions to /historical
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/bottom_stack.md
--- a/dwm.suckless.org/patches/bottom_stack.md Mon Sep 07 20:32:23 2009 +0100
+++ b/dwm.suckless.org/patches/bottom_stack.md Tue Sep 08 16:55:54 2009 +0200
_AT_@ -1,12 +1,25 @@
-BOTTOM STACK PATCH
-==================
+BOTTOM STACK
+============
Description
-----------
-This patch provides an additional bottom stack layout for the dwm window manager. (It no longer includes code for 'tileleft' or 'bstacklandscape'). Use 'patch -p0' when patching.
+`bstack` and `bstackhoriz` are two bottom stack layouts for dwm.
-Bottom Stack Tiling:
---------------------
+Include the sources in your `config.h` (after the definition of `mfact`)
+and update the layouts and key bindings.
+
+ #include "bstack.c"
+ #include "bstackhoriz.c"
+
+ static const Layout layouts[] = {
+ /* symbol arrange function */
+ ...
+ { "TTT", bstack },
+ { "===", bstackhoriz },
+
+
+Bottom Stack Tiling
+-------------------
bstack (TTT)
+-----------------+
_AT_@ -18,7 +31,18 @@
| | | |
+-----+-----+-----+
+ bstackhoriz (===)
+ +-----------------+
+ | |
+ | |
+ | |
+ +-----------------+
+ +-----------------+
+ +-----------------+
+ +-----------------+
+
Download
--------
-* [dwm-5.6.1-bstack.diff](
http://bsdgroup.org/files/dwm-5.6.1-bstack.diff) (2k) (20090726)
-* [dwm-5.5-bstack.diff](
http://bsdgroup.org/files/dwm-5.5-bstack.diff) (2k) (20090307)
+* [bstack.c](bstack.c) (dwm 5.6.1) (20090908)
+* [bstackhoriz.c](bstackhoriz.c) (dwm 5.6.1) (20090908)
+* see older versions in [historical patches](../historical)
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/bstack.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/bstack.c Tue Sep 08 16:55:54 2009 +0200
_AT_@ -0,0 +1,29 @@
+static void
+bstack(Monitor *m) {
+ int x, y, h, w, mh;
+ unsigned int i, n;
+ Client *c;
+
+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+ if(n == 0)
+ return;
+ /* master */
+ c = nexttiled(m->clients);
+ mh = m->mfact * m->wh;
+ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, (n == 1 ? m->wh : mh) - 2 * c->bw, False);
+ if(--n == 0)
+ return;
+ /* tile stack */
+ x = m->wx;
+ y = (m->wy + mh > c->y + c->h) ? c->y + c->h + 2 * c->bw : m->wy + mh;
+ w = m->ww / n;
+ h = (m->wy + mh > c->y + c->h) ? m->wy + m->wh - y : m->wh - mh;
+ if(w < bh)
+ w = m->ww;
+ for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
+ resize(c, x, y, /* remainder */ ((i + 1 == n)
+ ? m->wx + m->ww - x - 2 * c->bw : w - 2 * c->bw), h - 2 * c->bw, False);
+ if(w != m->ww)
+ x = c->x + WIDTH(c);
+ }
+}
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/bstackhoriz.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/bstackhoriz.c Tue Sep 08 16:55:54 2009 +0200
_AT_@ -0,0 +1,30 @@
+static void
+bstackhoriz(Monitor *m) {
+ int x, y, h, w, mh;
+ unsigned int i, n;
+ Client *c;
+
+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+ if(n == 0)
+ return;
+ /* master */
+ c = nexttiled(m->clients);
+ mh = m->mfact * m->wh;
+ resize(c, m->wx, m->wy, m->ww - 2 * c->bw, (n == 1 ? m->wh : mh) - 2 * c->bw, False);
+ if(--n == 0)
+ return;
+ /* tile stack */
+ x = m->wx;
+ y = (m->wy + mh > c->y + c->h) ? c->y + c->h + 2 * c->bw : m->wy + mh;
+ w = m->ww;
+ h = (m->wy + mh > c->y + c->h) ? m->wy + m->wh - y : m->wh - mh;
+ h /= n;
+ if(h < bh)
+ h = m->wh;
+ for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
+ resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n)
+ ? m->wy + m->wh - y - 2 * c->bw : h - 2 * c->bw), False);
+ if(h != m->wh)
+ y = c->y + HEIGHT(c);
+ }
+}
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/dwm-5.2-gaplessgrid.diff
--- a/dwm.suckless.org/patches/dwm-5.2-gaplessgrid.diff Mon Sep 07 20:32:23 2009 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
_AT_@ -1,59 +0,0 @@
-diff -up dwm-5.2-original/config.def.h dwm-5.2-modified/config.def.h
---- dwm-5.2-original/config.def.h 2008-09-09 21:46:17.000000000 +0200
-+++ dwm-5.2-modified/config.def.h 2008-10-20 20:07:42.000000000 +0200
-_AT_@ -28,11 +28,13 @@ static Rule rules[] = {
- static float mfact = 0.55; /* factor of master area size [0.05..0.95] */
- static Bool resizehints = True; /* False means respect size hints in tiled resizals */
-
-+#include "gaplessgrid.c"
- static Layout layouts[] = {
- /* symbol arrange function */
- { "[]=", tile }, /* first entry is default */
- { "><>", NULL }, /* no layout function means floating behavior */
- { "[M]", monocle },
-+ { "###", gaplessgrid },
- };
-
- /* key definitions */
-diff -up dwm-5.2-original/gaplessgrid.c dwm-5.2-modified/gaplessgrid.c
---- /dev/null 2008-10-20 20:09:51.000000000 +0200
-+++ dwm-5.2-modified/gaplessgrid.c 2008-10-20 20:06:59.000000000 +0200
-_AT_@ -0,0 +1,38 @@
-+void
-+gaplessgrid() {
-+ unsigned int n, cols, rows, cn, rn, i, cx, cy, cw, ch;
-+ Client *c;
-+
-+ for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
-+ n++;
-+ if(n == 0)
-+ return;
-+
-+ /* grid dimensions */
-+ for(cols = 0; cols <= n/2; cols++)
-+ if(cols*cols >= n)
-+ break;
-+ if(n == 5) /* set layout against the general calculation: not 1:2:2, but 2:3 */
-+ cols = 2;
-+ rows = n/cols;
-+
-+ /* window geometries (cell height/width/x/y) */
-+ cw = ww / (cols ? cols : 1);
-+ cn = 0; /* current column number */
-+ rn = 0; /* current row number */
-+ for(i = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) {
-+ if(i/rows+1 > cols-n%cols)
-+ rows = n/cols+1;
-+ ch = wh / (rows ? rows : 1);
-+ cx = wx + cn*cw;
-+ cy = wy + rn*ch;
-+ resize(c, cx, cy, cw - 2 * c->bw, ch - 2 * c->bw, False);
-+
-+ i++;
-+ rn++;
-+ if(rn >= rows) { /* jump to the next column */
-+ rn = 0;
-+ cn++;
-+ }
-+ }
-+}
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/dwm-r1437-gaplessgrid.diff
--- a/dwm.suckless.org/patches/dwm-r1437-gaplessgrid.diff Mon Sep 07 20:32:23 2009 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
_AT_@ -1,59 +0,0 @@
-diff -up dwm-5.2-original/config.def.h dwm-5.2-modified/config.def.h
---- dwm-5.2-original/config.def.h 2008-09-09 21:46:17.000000000 +0200
-+++ dwm-5.2-modified/config.def.h 2008-10-20 20:07:42.000000000 +0200
-_AT_@ -28,11 +28,13 @@ static Rule rules[] = {
- static float mfact = 0.55; /* factor of master area size [0.05..0.95] */
- static Bool resizehints = True; /* False means respect size hints in tiled resizals */
-
-+#include "gaplessgrid.c"
- static Layout layouts[] = {
- /* symbol arrange function */
- { "[]=", tile }, /* first entry is default */
- { "><>", NULL }, /* no layout function means floating behavior */
- { "[M]", monocle },
-+ { "###", gaplessgrid },
- };
-
- /* key definitions */
-diff -up dwm-5.2-original/gaplessgrid.c dwm-5.2-modified/gaplessgrid.c
---- /dev/null 2008-10-20 20:09:51.000000000 +0200
-+++ dwm-5.2-modified/gaplessgrid.c 2008-10-20 20:06:59.000000000 +0200
-_AT_@ -0,0 +1,38 @@
-+void
-+gaplessgrid(Monitor *m) {
-+ unsigned int n, cols, rows, cn, rn, i, cx, cy, cw, ch;
-+ Client *c;
-+
-+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next))
-+ n++;
-+ if(n == 0)
-+ return;
-+
-+ /* grid dimensions */
-+ for(cols = 0; cols <= n/2; cols++)
-+ if(cols*cols >= n)
-+ break;
-+ if(n == 5) /* set layout against the general calculation: not 1:2:2, but 2:3 */
-+ cols = 2;
-+ rows = n/cols;
-+
-+ /* window geometries (cell height/width/x/y) */
-+ cw = m->ww / (cols ? cols : 1);
-+ cn = 0; /* current column number */
-+ rn = 0; /* current row number */
-+ for(i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
-+ if(i/rows+1 > cols-n%cols)
-+ rows = n/cols+1;
-+ ch = m->wh / (rows ? rows : 1);
-+ cx = m->wx + cn*cw;
-+ cy = m->wy + rn*ch;
-+ resize(c, cx, cy, cw - 2 * c->bw, ch - 2 * c->bw);
-+
-+ i++;
-+ rn++;
-+ if(rn >= rows) { /* jump to the next column */
-+ rn = 0;
-+ cn++;
-+ }
-+ }
-+}
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/gapless_grid.md
--- a/dwm.suckless.org/patches/gapless_grid.md Mon Sep 07 20:32:23 2009 +0100
+++ b/dwm.suckless.org/patches/gapless_grid.md Tue Sep 08 16:55:54 2009 +0200
_AT_@ -1,34 +1,30 @@
-# GAPLESS GRID LAYOUT #
+# GAPLESS GRID LAYOUT
-## Description ##
+## Description
-This patch is similar to [gridmode][1] (in fact it is an altered version) in that it provides a layout for dwm, which arranges the windows in a grid. Though instead of using a regular grid, which in case leaves empty cells (e. g. with 3 windows there are 4 cells, one cell is empty), it uses the same number of columns, but adjusts the number of rows (at first x rows and (x+1) rows, when needed) leaving no empty cells.
+This patch is an altered [gridmode](../historical/gridmode) layout for dwm,
+which arranges the windows in a grid.
+Instead of using a regular grid, which might leave empty cells when there are
+not enough windows to fill the grid, it adjusts the number of windows in the
+first few columns to avoid empty cells.
+## Usage
-## Usage ##
+Download `gaplessgrid.c` and add the gapless layout to your `config.h`:
-Download the patch and apply it according to the [general instructions](.). The patch will make the following changes:
+ #include "gaplessgrid.c"
+
+ static const Layout layouts[] = {
+ /* symbol arrange function */
+ { "###", gaplessgrid },
+ ...
+
+ static Key keys[] = {
+ /* modifier key function argument */
+ { MODKEY, XK_g, setlayout, {.v = &layouts[0] } },
+ ...
- - gaplessgrid.c: adding the file
- - config.def.h: adding the include-line for 'gaplessgrid.c'
- - config.def.h: adding the layout '"###", gaplessgrid'
+## Download
-Comment: There may be problems applying the patch, if another layout has been added before.
-
-
-## Configuration ##
-
- * Transfer the changes made by the patch in 'config.def.h' to 'config.h', if needed.
- * Add a key definition like '{ MODKEY, XK_g, setlayout, {.v = &layouts[3]} },'.
-
-
-## Download ##
-
- * [dwm-5.2-gaplessgrid.diff][2] (1.9k) (20081020)
- * [dwm-r1437-gaplessgrid.diff][3] (1.9k) (20090704)
-
-
-[1]: /dwm/patches/gridmode.html
-[2]:
http://dwm.suckless.org/patches/dwm-5.2-gaplessgrid.diff
-[3]:
http://dwm.suckless.org/patches/dwm-r1437-gaplessgrid.diff
-
+* [gaplessgrid.c](gaplessgrid.c) (dwm 5.6.1) (20090908)
+* see [historical patches](../historical) for older versoins
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/gaplessgrid.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/gaplessgrid.c Tue Sep 08 16:55:54 2009 +0200
_AT_@ -0,0 +1,36 @@
+void
+gaplessgrid(Monitor *m) {
+ unsigned int n, cols, rows, cn, rn, i, cx, cy, cw, ch;
+ Client *c;
+
+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next))
+ n++;
+ if(n == 0)
+ return;
+
+ /* grid dimensions */
+ for(cols = 0; cols <= n/2; cols++)
+ if(cols*cols >= n)
+ break;
+ if(n == 5) /* set layout against the general calculation: not 1:2:2, but 2:3 */
+ cols = 2;
+ rows = n/cols;
+
+ /* window geometries */
+ cw = cols ? m->ww / cols : m->ww;
+ cn = 0; /* current column number */
+ rn = 0; /* current row number */
+ for(i = 0, c = nexttiled(m->clients); c; i++, c = nexttiled(c->next)) {
+ if(i/rows + 1 > cols - n%cols)
+ rows = n/cols + 1;
+ ch = rows ? m->wh / rows : m->wh;
+ cx = m->wx + cn*cw;
+ cy = m->wy + rn*ch;
+ resize(c, cx, cy, cw - 2 * c->bw, ch - 2 * c->bw, False);
+ rn++;
+ if(rn >= rows) {
+ rn = 0;
+ cn++;
+ }
+ }
+}
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/historical/bottom_stack.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/historical/bottom_stack.md Tue Sep 08 16:55:54 2009 +0200
_AT_@ -0,0 +1,24 @@
+BOTTOM STACK PATCH
+==================
+
+Description
+-----------
+This patch provides an additional bottom stack layout for the dwm window manager. (It no longer includes code for 'tileleft' or 'bstacklandscape'). Use 'patch -p0' when patching.
+
+Bottom Stack Tiling:
+--------------------
+
+ bstack (TTT)
+ +-----------------+
+ | |
+ | |
+ | |
+ +-----+-----+-----+
+ | | | |
+ | | | |
+ +-----+-----+-----+
+
+Download
+--------
+* [dwm-5.6.1-bstack.diff](
http://bsdgroup.org/files/dwm-5.6.1-bstack.diff) (2k) (20090726)
+* [dwm-5.5-bstack.diff](
http://bsdgroup.org/files/dwm-5.5-bstack.diff) (2k) (20090307)
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/historical/dwm-5.2-gaplessgrid.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/historical/dwm-5.2-gaplessgrid.diff Tue Sep 08 16:55:54 2009 +0200
_AT_@ -0,0 +1,59 @@
+diff -up dwm-5.2-original/config.def.h dwm-5.2-modified/config.def.h
+--- dwm-5.2-original/config.def.h 2008-09-09 21:46:17.000000000 +0200
++++ dwm-5.2-modified/config.def.h 2008-10-20 20:07:42.000000000 +0200
+_AT_@ -28,11 +28,13 @@ static Rule rules[] = {
+ static float mfact = 0.55; /* factor of master area size [0.05..0.95] */
+ static Bool resizehints = True; /* False means respect size hints in tiled resizals */
+
++#include "gaplessgrid.c"
+ static Layout layouts[] = {
+ /* symbol arrange function */
+ { "[]=", tile }, /* first entry is default */
+ { "><>", NULL }, /* no layout function means floating behavior */
+ { "[M]", monocle },
++ { "###", gaplessgrid },
+ };
+
+ /* key definitions */
+diff -up dwm-5.2-original/gaplessgrid.c dwm-5.2-modified/gaplessgrid.c
+--- /dev/null 2008-10-20 20:09:51.000000000 +0200
++++ dwm-5.2-modified/gaplessgrid.c 2008-10-20 20:06:59.000000000 +0200
+_AT_@ -0,0 +1,38 @@
++void
++gaplessgrid() {
++ unsigned int n, cols, rows, cn, rn, i, cx, cy, cw, ch;
++ Client *c;
++
++ for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
++ n++;
++ if(n == 0)
++ return;
++
++ /* grid dimensions */
++ for(cols = 0; cols <= n/2; cols++)
++ if(cols*cols >= n)
++ break;
++ if(n == 5) /* set layout against the general calculation: not 1:2:2, but 2:3 */
++ cols = 2;
++ rows = n/cols;
++
++ /* window geometries (cell height/width/x/y) */
++ cw = ww / (cols ? cols : 1);
++ cn = 0; /* current column number */
++ rn = 0; /* current row number */
++ for(i = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) {
++ if(i/rows+1 > cols-n%cols)
++ rows = n/cols+1;
++ ch = wh / (rows ? rows : 1);
++ cx = wx + cn*cw;
++ cy = wy + rn*ch;
++ resize(c, cx, cy, cw - 2 * c->bw, ch - 2 * c->bw, False);
++
++ i++;
++ rn++;
++ if(rn >= rows) { /* jump to the next column */
++ rn = 0;
++ cn++;
++ }
++ }
++}
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/historical/dwm-r1437-gaplessgrid.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/historical/dwm-r1437-gaplessgrid.diff Tue Sep 08 16:55:54 2009 +0200
_AT_@ -0,0 +1,59 @@
+diff -up dwm-5.2-original/config.def.h dwm-5.2-modified/config.def.h
+--- dwm-5.2-original/config.def.h 2008-09-09 21:46:17.000000000 +0200
++++ dwm-5.2-modified/config.def.h 2008-10-20 20:07:42.000000000 +0200
+_AT_@ -28,11 +28,13 @@ static Rule rules[] = {
+ static float mfact = 0.55; /* factor of master area size [0.05..0.95] */
+ static Bool resizehints = True; /* False means respect size hints in tiled resizals */
+
++#include "gaplessgrid.c"
+ static Layout layouts[] = {
+ /* symbol arrange function */
+ { "[]=", tile }, /* first entry is default */
+ { "><>", NULL }, /* no layout function means floating behavior */
+ { "[M]", monocle },
++ { "###", gaplessgrid },
+ };
+
+ /* key definitions */
+diff -up dwm-5.2-original/gaplessgrid.c dwm-5.2-modified/gaplessgrid.c
+--- /dev/null 2008-10-20 20:09:51.000000000 +0200
++++ dwm-5.2-modified/gaplessgrid.c 2008-10-20 20:06:59.000000000 +0200
+_AT_@ -0,0 +1,38 @@
++void
++gaplessgrid(Monitor *m) {
++ unsigned int n, cols, rows, cn, rn, i, cx, cy, cw, ch;
++ Client *c;
++
++ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next))
++ n++;
++ if(n == 0)
++ return;
++
++ /* grid dimensions */
++ for(cols = 0; cols <= n/2; cols++)
++ if(cols*cols >= n)
++ break;
++ if(n == 5) /* set layout against the general calculation: not 1:2:2, but 2:3 */
++ cols = 2;
++ rows = n/cols;
++
++ /* window geometries (cell height/width/x/y) */
++ cw = m->ww / (cols ? cols : 1);
++ cn = 0; /* current column number */
++ rn = 0; /* current row number */
++ for(i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
++ if(i/rows+1 > cols-n%cols)
++ rows = n/cols+1;
++ ch = m->wh / (rows ? rows : 1);
++ cx = m->wx + cn*cw;
++ cy = m->wy + rn*ch;
++ resize(c, cx, cy, cw - 2 * c->bw, ch - 2 * c->bw);
++
++ i++;
++ rn++;
++ if(rn >= rows) { /* jump to the next column */
++ rn = 0;
++ cn++;
++ }
++ }
++}
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/historical/gapless_grid.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/historical/gapless_grid.md Tue Sep 08 16:55:54 2009 +0200
_AT_@ -0,0 +1,34 @@
+# GAPLESS GRID LAYOUT #
+
+## Description ##
+
+This patch is similar to [gridmode][1] (in fact it is an altered version) in that it provides a layout for dwm, which arranges the windows in a grid. Though instead of using a regular grid, which in case leaves empty cells (e. g. with 3 windows there are 4 cells, one cell is empty), it uses the same number of columns, but adjusts the number of rows (at first x rows and (x+1) rows, when needed) leaving no empty cells.
+
+
+## Usage ##
+
+Download the patch and apply it according to the [general instructions](.). The patch will make the following changes:
+
+ - gaplessgrid.c: adding the file
+ - config.def.h: adding the include-line for 'gaplessgrid.c'
+ - config.def.h: adding the layout '"###", gaplessgrid'
+
+Comment: There may be problems applying the patch, if another layout has been added before.
+
+
+## Configuration ##
+
+ * Transfer the changes made by the patch in 'config.def.h' to 'config.h', if needed.
+ * Add a key definition like '{ MODKEY, XK_g, setlayout, {.v = &layouts[3]} },'.
+
+
+## Download ##
+
+ * [dwm-5.2-gaplessgrid.diff][2] (1.9k) (20081020)
+ * [dwm-r1437-gaplessgrid.diff][3] (1.9k) (20090704)
+
+
+[1]: /dwm/patches/gridmode.html
+[2]:
http://dwm.suckless.org/patches/dwm-5.2-gaplessgrid.diff
+[3]:
http://dwm.suckless.org/patches/dwm-r1437-gaplessgrid.diff
+
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/historical/nmaster+bstack-5.6.1.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/historical/nmaster+bstack-5.6.1.diff Tue Sep 08 16:55:54 2009 +0200
_AT_@ -0,0 +1,195 @@
+diff -r e47a47bd3ed4 config.def.h
+--- a/config.def.h Tue Jul 21 10:57:54 2009 +0100
++++ b/config.def.h Mon Aug 24 17:14:00 2009 +0200
+_AT_@ -24,11 +24,13 @@
+
+ /* layout(s) */
+ static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
++static const int nmaster = 1; /* default number of master windows */
+ static const Bool resizehints = True; /* False means respect size hints in tiled resizals */
+
+ static const Layout layouts[] = {
+ /* symbol arrange function */
+ { "[]=", tile }, /* first entry is default */
++ { "TTT", bstack },
+ { "><>", NULL }, /* no layout function means floating behavior */
+ { "[M]", monocle },
+ };
+_AT_@ -57,12 +59,15 @@
+ { MODKEY, XK_k, focusstack, {.i = -1 } },
+ { MODKEY, XK_h, setmfact, {.f = -0.05} },
+ { MODKEY, XK_l, setmfact, {.f = +0.05} },
++ { MODKEY|ShiftMask, XK_h, incnmaster, {.i = +1 } },
++ { MODKEY|ShiftMask, XK_l, incnmaster, {.i = -1 } },
+ { MODKEY, XK_Return, zoom, {0} },
+ { MODKEY, XK_Tab, view, {0} },
+ { MODKEY|ShiftMask, XK_c, killclient, {0} },
+ { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
+- { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
+- { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
++ { MODKEY, XK_o, setlayout, {.v = &layouts[1]} },
++ { MODKEY, XK_f, setlayout, {.v = &layouts[2]} },
++ { MODKEY, XK_m, setlayout, {.v = &layouts[3]} },
+ { MODKEY, XK_space, setlayout, {0} },
+ { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
+ { MODKEY, XK_0, view, {.ui = ~0 } },
+diff -r e47a47bd3ed4 dwm.c
+--- a/dwm.c Tue Jul 21 10:57:54 2009 +0100
++++ b/dwm.c Mon Aug 24 17:14:00 2009 +0200
+_AT_@ -122,6 +122,7 @@
+
+ struct Monitor {
+ float mfact;
++ int nmaster;
+ int num;
+ int by; /* bar geometry */
+ int mx, my, mw, mh; /* screen size */
+_AT_@ -205,6 +206,8 @@
+ static void setclientstate(Client *c, long state);
+ static void setlayout(const Arg *arg);
+ static void setmfact(const Arg *arg);
++static void incnmaster(const Arg *arg);
++static void setnmaster(const Arg *arg);
+ static void setup(void);
+ static void showhide(Client *c);
+ static void sigchld(int signal);
+_AT_@ -213,6 +216,7 @@
+ static void tagmon(const Arg *arg);
+ static int textnw(const char *text, unsigned int len);
+ static void tile(Monitor *);
++static void bstack(Monitor *);
+ static void togglebar(const Arg *arg);
+ static void togglefloating(const Arg *arg);
+ static void toggletag(const Arg *arg);
+_AT_@ -1423,6 +1427,24 @@
+ }
+
+ void
++incnmaster(const Arg *arg) {
++ if(!arg || !selmon->lt[selmon->sellt]->arrange)
++ return;
++ selmon->nmaster += arg->i;
++ if(selmon->nmaster < 0) selmon->nmaster = 0;
++ arrange();
++}
++
++void
++setnmaster(const Arg *arg) {
++ if(!arg || !selmon->lt[selmon->sellt]->arrange)
++ return;
++ selmon->nmaster = arg->i;
++ if(selmon->nmaster < 0) selmon->nmaster = 0;
++ arrange();
++}
++
++void
+ setup(void) {
+ unsigned int i;
+ int w;
+_AT_@ -1542,7 +1564,7 @@
+
+ void
+ tile(Monitor *m) {
+- int x, y, h, w, mw;
++ int x, y, h, w, mw, nm;
+ unsigned int i, n;
+ Client *c;
+
+_AT_@ -1550,23 +1572,81 @@
+ if(n == 0)
+ return;
+ /* master */
+- c = nexttiled(m->clients);
+- mw = m->mfact * m->ww;
+- resize(c, m->wx, m->wy, (n == 1 ? m->ww : mw) - 2 * c->bw, m->wh - 2 * c->bw, False);
+- if(--n == 0)
+- return;
++ if(m->nmaster > 0) {
++ nm = n < m->nmaster ? n : m->nmaster;
++ c = nexttiled(m->clients);
++ mw = m->mfact * m->ww;
++ h = m->wh / nm;
++ y = m->wy;
++ for(i=0; i<nm; i++, c = nexttiled(c->next)) {
++ resize(c, m->wx, y, (n == nm ? m->ww : mw) - 2 * c->bw,
++ ((i + 1 == nm) ? m->wy + m->wh - y : h) - 2 * c->bw, False);
++ if(h != m->wh)
++ y = c->y + HEIGHT(c);
++ }
++ n -= nm;
++ if(n == 0) return;
++ } else {
++ mw = 0;
++ c = nexttiled(m->clients);
++ }
+ /* tile stack */
+- x = (m->wx + mw > c->x + c->w) ? c->x + c->w + 2 * c->bw : m->wx + mw;
++ x = m->wx + mw;
+ y = m->wy;
+- w = (m->wx + mw > c->x + c->w) ? m->wx + m->ww - x : m->ww - mw;
++ w = m->ww - mw;
+ h = m->wh / n;
+ if(h < bh)
+ h = m->wh;
+- for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
++ for(i = 0; c; c = nexttiled(c->next), i++) {
+ resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n)
+ ? m->wy + m->wh - y - 2 * c->bw : h - 2 * c->bw), False);
+ if(h != m->wh)
+ y = c->y + HEIGHT(c);
++ }
++}
++
++void
++bstack(Monitor *m) {
++ int x, y, h, w, mh, nm;
++ unsigned int i, n;
++ Client *c;
++
++ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
++ if(n == 0)
++ return;
++
++ if(m->nmaster > 0) {
++ nm = n < m->nmaster ? n : m->nmaster;
++ c = nexttiled(m->clients);
++ mh = m->mfact * m->wh;
++ x = m->wx;
++ h = m->wh;
++ w = m->ww / nm;
++ for(i=0; i<nm; i++, c = nexttiled(c->next)) {
++ resize(c, x, m->wy, ((i + 1 == nm) ? m->wx + m->ww - x : w) - 2 * c->bw,
++ (n == nm ? m->wh : mh) - 2 * c->bw, False);
++ if(w != m->ww)
++ x = c->x + WIDTH(c);
++ }
++ n -= nm;
++ if(n == 0) return;
++ } else {
++ mh = 0;
++ c = nexttiled(m->clients);
++ }
++
++ x = m->wx;
++ y = m->wy + mh;
++ w = m->ww / n;
++ h = m->wh - mh;
++ if(h < bh)
++ h = m->wh;
++
++ for(i = 0; c; c = nexttiled(c->next), i++) {
++ resize(c, x, y, ((i + 1 == n) ? m->wx + m->ww - x : w) - 2 * c->bw,
++ h - 2 * c->bw, False);
++ if(w != m->ww)
++ x = c->x + WIDTH(c);
+ }
+ }
+
+_AT_@ -1734,6 +1814,7 @@
+ m->sellt = 0;
+ m->tagset[0] = m->tagset[1] = 1;
+ m->mfact = mfact;
++ m->nmaster = nmaster;
+ m->showbar = showbar;
+ m->topbar = topbar;
+ m->lt[0] = &layouts[0];
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/historical/nmaster.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/historical/nmaster.md Tue Sep 08 16:55:54 2009 +0200
_AT_@ -0,0 +1,58 @@
+# NMASTER PATCH
+
+## Description
+
+This patch restores the ability to have multiple clients in the master area of the tiled layout.
+This feature was dropped from vanilla dwm in version 4.4.
+
+See [nmaster.c][1] header documentation for installing this patch with tilecols and clientspertag for dwm 4.6.
+
+ ntile (-|=)
+ +----------+------+
+ | | |
+ | +------+
+ |----------| |
+ | +------+
+ | | |
+ +----------+------+
+
+NOTE: The nmaster.c (patch for dwm 4.6) mixes the clientspertag patch together with another layout called tilecols.
+
+## Usage
+
+ 1. Download the patch and apply according to the [general instructions](.).
+ 2. Add the `NMASTER` value to your `config.h`.
+ Example from `config.default.h`:
+
+ #define NMASTER 2 /* clients in master area*/
+
+ 3. Add keybindings to `incmaster()` to your `config.h`.
+ Example from `config.default.h`:
+
+ { MODKEY|ShiftMask, XK_k, incnmaster, "-1" }, \
+ { MODKEY|ShiftMask, XK_j, incnmaster, "1" }, \
+
+The nmaster patch for dwm 4.6 (current development hg branch) installation is far more simple.
+Installation instructions are placed on the top of the .c file.
+
+The nmaster patch for dwm 4.6 adds two new layouts called ntile (classic) and dntile (dinamic).
+
+## Download
+
+ * [nmaster-4.7.c][4] (dwm 4.7) (7.3kb (20071123)
+ * [nmaster.c][3] (dwm 4.6) (7.3kb) (20071025)
+ - contains ntile, dntile and tilecols. Also supports the clients-per-tag
+ * [nmaster-4.5.diff][2] (dwm 4.5) (2.7kb) (20071016)
+ * [dwm-4.4.1-nmaster.diff][1] (dwm 4.4) (2.8kb) (20070826)
+ * [nmaster+bstack-5.6.1.diff](nmaster+bstack-5.6.1.diff) (dwm 5.6.1) (5.9kb) (20090824)
+ - another variation; contains bstack with nmaster support
+
+[1]:
http://schot.a-eskwadraat.nl/files/dwm-4.4.1-nmaster.diff
+[2]:
http://news.nopcode.org/nmaster-4.5.patch
+[3]:
http://news.nopcode.org/nmaster.c
+[4]:
http://news.nopcode.org/nmaster-4.7.c
+
+## Maintainer
+
+ * pancake <youterm.com>
+
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/historical/push-5.3.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/historical/push-5.3.c Tue Sep 08 16:55:54 2009 +0200
_AT_@ -0,0 +1,56 @@
+static Client *
+prevtiled(Client *c) {
+ Client *p, *r;
+
+ for (p = clients, r = NULL; p && p != c; p = p->next)
+ if (!p->isfloating && ISVISIBLE(p))
+ r = p;
+ return r;
+}
+
+static void
+pushup(const Arg *arg) {
+ Client *c;
+
+ if (!sel || sel->isfloating)
+ return;
+ if ((c = prevtiled(sel))) {
+ /* attach before c */
+ detach(sel);
+ sel->next = c;
+ if (clients == c)
+ clients = sel;
+ else {
+ for (c = clients; c->next != sel->next; c = c->next);
+ c->next = sel;
+ }
+ } else {
+ /* move to the end */
+ for (c = sel; c->next; c = c->next);
+ detach(sel);
+ sel->next = NULL;
+ c->next = sel;
+ }
+ focus(sel);
+ arrange();
+}
+
+static void
+pushdown(const Arg *arg) {
+ Client *c;
+
+ if (!sel || sel->isfloating)
+ return;
+ if ((c = nexttiled(sel->next))) {
+ /* attach after c */
+ detach(sel);
+ sel->next = c->next;
+ c->next = sel;
+ } else {
+ /* move to the front */
+ detach(sel);
+ attach(sel);
+ }
+ focus(sel);
+ arrange();
+}
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/historical/push-5.6.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/historical/push-5.6.c Tue Sep 08 16:55:54 2009 +0200
_AT_@ -0,0 +1,58 @@
+static Client *
+prevtiled(Client *c) {
+ Client *p, *r;
+
+ for(p = selmon->clients, r = NULL; p && p != c; p = p->next)
+ if(!p->isfloating && ISVISIBLE(p))
+ r = p;
+ return r;
+}
+
+static void
+pushup(const Arg *arg) {
+ Client *sel = selmon->sel;
+ Client *c;
+
+ if(!sel || sel->isfloating)
+ return;
+ if((c = prevtiled(sel))) {
+ /* attach before c */
+ detach(sel);
+ sel->next = c;
+ if(selmon->clients == c)
+ selmon->clients = sel;
+ else {
+ for(c = selmon->clients; c->next != sel->next; c = c->next);
+ c->next = sel;
+ }
+ } else {
+ /* move to the end */
+ for(c = sel; c->next; c = c->next);
+ detach(sel);
+ sel->next = NULL;
+ c->next = sel;
+ }
+ focus(sel);
+ arrange();
+}
+
+static void
+pushdown(const Arg *arg) {
+ Client *sel = selmon->sel;
+ Client *c;
+
+ if(!sel || sel->isfloating)
+ return;
+ if((c = nexttiled(sel->next))) {
+ /* attach after c */
+ detach(sel);
+ sel->next = c->next;
+ c->next = sel;
+ } else {
+ /* move to the front */
+ detach(sel);
+ attach(sel);
+ }
+ focus(sel);
+ arrange();
+}
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/historical/push.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/historical/push.md Tue Sep 08 16:55:54 2009 +0200
_AT_@ -0,0 +1,16 @@
+# PUSH UP/DOWN
+
+## Description
+
+This patch provides a way to move clients position inside the clients list.
+
+ #include "push-5.6.c"
+
+ { MODKEY|ControlMask, XK_j, pushdown, {0} },
+ { MODKEY|ControlMask, XK_k, pushup, {0} },
+
+## Download
+
+ * [push-5.6.c](push-5.6.c) (1K) (20090709)
+ * [push-5.3.c](push-5.3.c) (1K) (20090124)
+
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/nmaster+bstack-5.6.1.diff
--- a/dwm.suckless.org/patches/nmaster+bstack-5.6.1.diff Mon Sep 07 20:32:23 2009 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
_AT_@ -1,195 +0,0 @@
-diff -r e47a47bd3ed4 config.def.h
---- a/config.def.h Tue Jul 21 10:57:54 2009 +0100
-+++ b/config.def.h Mon Aug 24 17:14:00 2009 +0200
-_AT_@ -24,11 +24,13 @@
-
- /* layout(s) */
- static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
-+static const int nmaster = 1; /* default number of master windows */
- static const Bool resizehints = True; /* False means respect size hints in tiled resizals */
-
- static const Layout layouts[] = {
- /* symbol arrange function */
- { "[]=", tile }, /* first entry is default */
-+ { "TTT", bstack },
- { "><>", NULL }, /* no layout function means floating behavior */
- { "[M]", monocle },
- };
-_AT_@ -57,12 +59,15 @@
- { MODKEY, XK_k, focusstack, {.i = -1 } },
- { MODKEY, XK_h, setmfact, {.f = -0.05} },
- { MODKEY, XK_l, setmfact, {.f = +0.05} },
-+ { MODKEY|ShiftMask, XK_h, incnmaster, {.i = +1 } },
-+ { MODKEY|ShiftMask, XK_l, incnmaster, {.i = -1 } },
- { MODKEY, XK_Return, zoom, {0} },
- { MODKEY, XK_Tab, view, {0} },
- { MODKEY|ShiftMask, XK_c, killclient, {0} },
- { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
-- { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
-- { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
-+ { MODKEY, XK_o, setlayout, {.v = &layouts[1]} },
-+ { MODKEY, XK_f, setlayout, {.v = &layouts[2]} },
-+ { MODKEY, XK_m, setlayout, {.v = &layouts[3]} },
- { MODKEY, XK_space, setlayout, {0} },
- { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
- { MODKEY, XK_0, view, {.ui = ~0 } },
-diff -r e47a47bd3ed4 dwm.c
---- a/dwm.c Tue Jul 21 10:57:54 2009 +0100
-+++ b/dwm.c Mon Aug 24 17:14:00 2009 +0200
-_AT_@ -122,6 +122,7 @@
-
- struct Monitor {
- float mfact;
-+ int nmaster;
- int num;
- int by; /* bar geometry */
- int mx, my, mw, mh; /* screen size */
-_AT_@ -205,6 +206,8 @@
- static void setclientstate(Client *c, long state);
- static void setlayout(const Arg *arg);
- static void setmfact(const Arg *arg);
-+static void incnmaster(const Arg *arg);
-+static void setnmaster(const Arg *arg);
- static void setup(void);
- static void showhide(Client *c);
- static void sigchld(int signal);
-_AT_@ -213,6 +216,7 @@
- static void tagmon(const Arg *arg);
- static int textnw(const char *text, unsigned int len);
- static void tile(Monitor *);
-+static void bstack(Monitor *);
- static void togglebar(const Arg *arg);
- static void togglefloating(const Arg *arg);
- static void toggletag(const Arg *arg);
-_AT_@ -1423,6 +1427,24 @@
- }
-
- void
-+incnmaster(const Arg *arg) {
-+ if(!arg || !selmon->lt[selmon->sellt]->arrange)
-+ return;
-+ selmon->nmaster += arg->i;
-+ if(selmon->nmaster < 0) selmon->nmaster = 0;
-+ arrange();
-+}
-+
-+void
-+setnmaster(const Arg *arg) {
-+ if(!arg || !selmon->lt[selmon->sellt]->arrange)
-+ return;
-+ selmon->nmaster = arg->i;
-+ if(selmon->nmaster < 0) selmon->nmaster = 0;
-+ arrange();
-+}
-+
-+void
- setup(void) {
- unsigned int i;
- int w;
-_AT_@ -1542,7 +1564,7 @@
-
- void
- tile(Monitor *m) {
-- int x, y, h, w, mw;
-+ int x, y, h, w, mw, nm;
- unsigned int i, n;
- Client *c;
-
-_AT_@ -1550,23 +1572,81 @@
- if(n == 0)
- return;
- /* master */
-- c = nexttiled(m->clients);
-- mw = m->mfact * m->ww;
-- resize(c, m->wx, m->wy, (n == 1 ? m->ww : mw) - 2 * c->bw, m->wh - 2 * c->bw, False);
-- if(--n == 0)
-- return;
-+ if(m->nmaster > 0) {
-+ nm = n < m->nmaster ? n : m->nmaster;
-+ c = nexttiled(m->clients);
-+ mw = m->mfact * m->ww;
-+ h = m->wh / nm;
-+ y = m->wy;
-+ for(i=0; i<nm; i++, c = nexttiled(c->next)) {
-+ resize(c, m->wx, y, (n == nm ? m->ww : mw) - 2 * c->bw,
-+ ((i + 1 == nm) ? m->wy + m->wh - y : h) - 2 * c->bw, False);
-+ if(h != m->wh)
-+ y = c->y + HEIGHT(c);
-+ }
-+ n -= nm;
-+ if(n == 0) return;
-+ } else {
-+ mw = 0;
-+ c = nexttiled(m->clients);
-+ }
- /* tile stack */
-- x = (m->wx + mw > c->x + c->w) ? c->x + c->w + 2 * c->bw : m->wx + mw;
-+ x = m->wx + mw;
- y = m->wy;
-- w = (m->wx + mw > c->x + c->w) ? m->wx + m->ww - x : m->ww - mw;
-+ w = m->ww - mw;
- h = m->wh / n;
- if(h < bh)
- h = m->wh;
-- for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
-+ for(i = 0; c; c = nexttiled(c->next), i++) {
- resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n)
- ? m->wy + m->wh - y - 2 * c->bw : h - 2 * c->bw), False);
- if(h != m->wh)
- y = c->y + HEIGHT(c);
-+ }
-+}
-+
-+void
-+bstack(Monitor *m) {
-+ int x, y, h, w, mh, nm;
-+ unsigned int i, n;
-+ Client *c;
-+
-+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
-+ if(n == 0)
-+ return;
-+
-+ if(m->nmaster > 0) {
-+ nm = n < m->nmaster ? n : m->nmaster;
-+ c = nexttiled(m->clients);
-+ mh = m->mfact * m->wh;
-+ x = m->wx;
-+ h = m->wh;
-+ w = m->ww / nm;
-+ for(i=0; i<nm; i++, c = nexttiled(c->next)) {
-+ resize(c, x, m->wy, ((i + 1 == nm) ? m->wx + m->ww - x : w) - 2 * c->bw,
-+ (n == nm ? m->wh : mh) - 2 * c->bw, False);
-+ if(w != m->ww)
-+ x = c->x + WIDTH(c);
-+ }
-+ n -= nm;
-+ if(n == 0) return;
-+ } else {
-+ mh = 0;
-+ c = nexttiled(m->clients);
-+ }
-+
-+ x = m->wx;
-+ y = m->wy + mh;
-+ w = m->ww / n;
-+ h = m->wh - mh;
-+ if(h < bh)
-+ h = m->wh;
-+
-+ for(i = 0; c; c = nexttiled(c->next), i++) {
-+ resize(c, x, y, ((i + 1 == n) ? m->wx + m->ww - x : w) - 2 * c->bw,
-+ h - 2 * c->bw, False);
-+ if(w != m->ww)
-+ x = c->x + WIDTH(c);
- }
- }
-
-_AT_@ -1734,6 +1814,7 @@
- m->sellt = 0;
- m->tagset[0] = m->tagset[1] = 1;
- m->mfact = mfact;
-+ m->nmaster = nmaster;
- m->showbar = showbar;
- m->topbar = topbar;
- m->lt[0] = &layouts[0];
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/nmaster.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/nmaster.c Tue Sep 08 16:55:54 2009 +0200
_AT_@ -0,0 +1,122 @@
+enum {MaxMon = 8};
+static int nmasters[MaxMon];
+static int initnm = 0;
+
+static void
+initnmaster(void) {
+ int i;
+
+ if(initnm)
+ return;
+ for(i = 0; i < MaxMon; i++)
+ nmasters[i] = nmaster;
+ initnm = 1;
+}
+
+static void
+incnmaster(const Arg *arg) {
+ if(!arg || !selmon->lt[selmon->sellt]->arrange || selmon->num >= MaxMon)
+ return;
+ nmasters[selmon->num] += arg->i;
+ if(nmasters[selmon->num] < 0)
+ nmasters[selmon->num] = 0;
+ arrange();
+}
+
+static void
+setnmaster(const Arg *arg) {
+ if(!arg || !selmon->lt[selmon->sellt]->arrange || selmon->num >= MaxMon)
+ return;
+ nmasters[selmon->num] = arg->i > 0 ? arg->i : 0;
+ arrange();
+}
+
+static void
+ntile(Monitor *m) {
+ int x, y, h, w, mw, nm;
+ unsigned int i, n;
+ Client *c;
+
+ initnmaster();
+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+ c = nexttiled(m->clients);
+ nm = m->num < MaxMon ? nmasters[m->num] : nmaster;
+ if(nm > n)
+ nm = n;
+ /* master */
+ if(nm > 0) {
+ mw = m->mfact * m->ww;
+ h = m->wh / nm;
+ if(h < bh)
+ h = m->wh;
+ y = m->wy;
+ for(i = 0; i < nm; i++, c = nexttiled(c->next)) {
+ resize(c, m->wx, y, (n == nm ? m->ww : mw) - 2 * c->bw,
+ ((i + 1 == nm) ? m->wy + m->wh - y : h) - 2 * c->bw, False);
+ if(h != m->wh)
+ y = c->y + HEIGHT(c);
+ }
+ n -= nm;
+ } else
+ mw = 0;
+ if(n == 0)
+ return;
+ /* tile stack */
+ x = m->wx + mw;
+ y = m->wy;
+ w = m->ww - mw;
+ h = m->wh / n;
+ if(h < bh)
+ h = m->wh;
+ for(i = 0; c; c = nexttiled(c->next), i++) {
+ resize(c, x, y, w - 2 * c->bw,
+ ((i + 1 == n) ? m->wy + m->wh - y : h) - 2 * c->bw, False);
+ if(h != m->wh)
+ y = c->y + HEIGHT(c);
+ }
+}
+
+static void
+nbstack(Monitor *m) {
+ int x, y, h, w, mh, nm;
+ unsigned int i, n;
+ Client *c;
+
+ initnmaster();
+ for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+ c = nexttiled(m->clients);
+ nm = m->num < MaxMon ? nmasters[m->num] : nmaster;
+ if(nm > n)
+ nm = n;
+ /* master */
+ if(nm > 0) {
+ mh = m->mfact * m->wh;
+ w = m->ww / nm;
+ if(w < bh)
+ w = m->ww;
+ x = m->wx;
+ for(i = 0; i < nm; i++, c = nexttiled(c->next)) {
+ resize(c, x, m->wy, ((i + 1 == nm) ? m->wx + m->ww - x : w) - 2 * c->bw,
+ (n == nm ? m->wh : mh) - 2 * c->bw, False);
+ if(w != m->ww)
+ x = c->x + WIDTH(c);
+ }
+ n -= nm;
+ } else
+ mh = 0;
+ if(n == 0)
+ return;
+ /* tile stack */
+ x = m->wx;
+ y = m->wy + mh;
+ w = m->ww / n;
+ h = m->wh - mh;
+ if(w < bh)
+ w = m->ww;
+ for(i = 0; c; c = nexttiled(c->next), i++) {
+ resize(c, x, y, ((i + 1 == n) ? m->wx + m->ww - x : w) - 2 * c->bw,
+ h - 2 * c->bw, False);
+ if(w != m->ww)
+ x = c->x + WIDTH(c);
+ }
+}
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/nmaster.md
--- a/dwm.suckless.org/patches/nmaster.md Mon Sep 07 20:32:23 2009 +0100
+++ b/dwm.suckless.org/patches/nmaster.md Tue Sep 08 16:55:54 2009 +0200
_AT_@ -5,54 +5,54 @@
This patch restores the ability to have multiple clients in the master area of the tiled layout.
This feature was dropped from vanilla dwm in version 4.4.
-See [nmaster.c][1] header documentation for installing this patch with tilecols and clientspertag for dwm 4.6.
+ ntile (-|=)
+ +----------+------+
+ | | |
+ | +------+
+ |----------| |
+ | +------+
+ | | |
+ +----------+------+
- ntile (-|=)
- +----------+------+
- | | |
- | +------+
- |----------| |
- | +------+
- | | |
- +----------+------+
-
-NOTE: The nmaster.c (patch for dwm 4.6) mixes the clientspertag patch together with another layout called tilecols.
+ nbstack (-|-)
+ +--------+--------+
+ | | |
+ | | |
+ |-----+--+--+-----+
+ | | | |
+ | | | |
+ +-----+-----+-----+
## Usage
- 1. Download the patch and apply according to the [general instructions](.).
- 2. Add the `NMASTER` value to your `config.h`.
- Example from `config.default.h`:
+* Download `nmaster.c` into the source directory of dwm.
+* Add `nmaster` default value to your `config.h`.
+* Include `nmaster.c` in `config.h` after the definition of `nmaster`.
+* Add `ntile` and/or `nbstack` to your layouts.
+* Add keybindings to `incnmaster` and/or `setnmaster` to your `config.h`.
- #define NMASTER 2 /* clients in master area*/
+## Example
- 3. Add keybindings to `incmaster()` to your `config.h`.
- Example from `config.default.h`:
-
- { MODKEY|ShiftMask, XK_k, incnmaster, "-1" }, \
- { MODKEY|ShiftMask, XK_j, incnmaster, "1" }, \
-
-The nmaster patch for dwm 4.6 (current development hg branch) installation is far more simple.
-Installation instructions are placed on the top of the .c file.
-
-The nmaster patch for dwm 4.6 adds two new layouts called ntile (classic) and dntile (dinamic).
+ static const int nmaster = 2; /* default number of clients in the master area */
+
+ #include "nmaster.c"
+
+ static const Layout layouts[] = {
+ /* symbol arrange function */
+ { "-|=", ntile },
+ { "-|-", nbstack },
+ ...
+
+ static Key keys[] = {
+ /* modifier key function argument */
+ { MODKEY, XK_a, incmaster, {.i = +1 } },
+ { MODKEY, XK_z, incmaster, {.i = -1 } },
+ { MODKEY, XK_x, setmaster, {.i = 2 } },
+ { MODKEY, XK_t, setlayout, {.v = &layouts[0] } },
+ { MODKEY, XK_b, setlayout, {.v = &layouts[1] } },
+ ...
## Download
- * [nmaster-4.7.c][4] (dwm 4.7) (7.3kb (20071123)
- * [nmaster.c][3] (dwm 4.6) (7.3kb) (20071025)
- - contains ntile, dntile and tilecols. Also supports the clients-per-tag
- * [nmaster-4.5.diff][2] (dwm 4.5) (2.7kb) (20071016)
- * [dwm-4.4.1-nmaster.diff][1] (dwm 4.4) (2.8kb) (20070826)
- * [nmaster+bstack-5.6.1.diff](nmaster+bstack-5.6.1.diff) (dwm 5.6.1) (5.9kb) (20090824)
- - another variation; contains bstack with nmaster support
-
-[1]:
http://schot.a-eskwadraat.nl/files/dwm-4.4.1-nmaster.diff
-[2]:
http://news.nopcode.org/nmaster-4.5.patch
-[3]:
http://news.nopcode.org/nmaster.c
-[4]:
http://news.nopcode.org/nmaster-4.7.c
-
-## Maintainer
-
- * pancake <youterm.com>
-
+* [nmaster.c](nmaster.c) (dwm 5.6.1) (20090908)
+* see older versions in [historical patches](../historical)
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/push-5.3.c
--- a/dwm.suckless.org/patches/push-5.3.c Mon Sep 07 20:32:23 2009 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
_AT_@ -1,56 +0,0 @@
-static Client *
-prevtiled(Client *c) {
- Client *p, *r;
-
- for (p = clients, r = NULL; p && p != c; p = p->next)
- if (!p->isfloating && ISVISIBLE(p))
- r = p;
- return r;
-}
-
-static void
-pushup(const Arg *arg) {
- Client *c;
-
- if (!sel || sel->isfloating)
- return;
- if ((c = prevtiled(sel))) {
- /* attach before c */
- detach(sel);
- sel->next = c;
- if (clients == c)
- clients = sel;
- else {
- for (c = clients; c->next != sel->next; c = c->next);
- c->next = sel;
- }
- } else {
- /* move to the end */
- for (c = sel; c->next; c = c->next);
- detach(sel);
- sel->next = NULL;
- c->next = sel;
- }
- focus(sel);
- arrange();
-}
-
-static void
-pushdown(const Arg *arg) {
- Client *c;
-
- if (!sel || sel->isfloating)
- return;
- if ((c = nexttiled(sel->next))) {
- /* attach after c */
- detach(sel);
- sel->next = c->next;
- c->next = sel;
- } else {
- /* move to the front */
- detach(sel);
- attach(sel);
- }
- focus(sel);
- arrange();
-}
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/push-5.6.c
--- a/dwm.suckless.org/patches/push-5.6.c Mon Sep 07 20:32:23 2009 +0100
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
_AT_@ -1,58 +0,0 @@
-static Client *
-prevtiled(Client *c) {
- Client *p, *r;
-
- for(p = selmon->clients, r = NULL; p && p != c; p = p->next)
- if(!p->isfloating && ISVISIBLE(p))
- r = p;
- return r;
-}
-
-static void
-pushup(const Arg *arg) {
- Client *sel = selmon->sel;
- Client *c;
-
- if(!sel || sel->isfloating)
- return;
- if((c = prevtiled(sel))) {
- /* attach before c */
- detach(sel);
- sel->next = c;
- if(selmon->clients == c)
- selmon->clients = sel;
- else {
- for(c = selmon->clients; c->next != sel->next; c = c->next);
- c->next = sel;
- }
- } else {
- /* move to the end */
- for(c = sel; c->next; c = c->next);
- detach(sel);
- sel->next = NULL;
- c->next = sel;
- }
- focus(sel);
- arrange();
-}
-
-static void
-pushdown(const Arg *arg) {
- Client *sel = selmon->sel;
- Client *c;
-
- if(!sel || sel->isfloating)
- return;
- if((c = nexttiled(sel->next))) {
- /* attach after c */
- detach(sel);
- sel->next = c->next;
- c->next = sel;
- } else {
- /* move to the front */
- detach(sel);
- attach(sel);
- }
- focus(sel);
- arrange();
-}
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/push.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/push.c Tue Sep 08 16:55:54 2009 +0200
_AT_@ -0,0 +1,58 @@
+static Client *
+prevtiled(Client *c) {
+ Client *p, *r;
+
+ for(p = selmon->clients, r = NULL; p && p != c; p = p->next)
+ if(!p->isfloating && ISVISIBLE(p))
+ r = p;
+ return r;
+}
+
+static void
+pushup(const Arg *arg) {
+ Client *sel = selmon->sel;
+ Client *c;
+
+ if(!sel || sel->isfloating)
+ return;
+ if((c = prevtiled(sel))) {
+ /* attach before c */
+ detach(sel);
+ sel->next = c;
+ if(selmon->clients == c)
+ selmon->clients = sel;
+ else {
+ for(c = selmon->clients; c->next != sel->next; c = c->next);
+ c->next = sel;
+ }
+ } else {
+ /* move to the end */
+ for(c = sel; c->next; c = c->next);
+ detach(sel);
+ sel->next = NULL;
+ c->next = sel;
+ }
+ focus(sel);
+ arrange();
+}
+
+static void
+pushdown(const Arg *arg) {
+ Client *sel = selmon->sel;
+ Client *c;
+
+ if(!sel || sel->isfloating)
+ return;
+ if((c = nexttiled(sel->next))) {
+ /* attach after c */
+ detach(sel);
+ sel->next = c->next;
+ c->next = sel;
+ } else {
+ /* move to the front */
+ detach(sel);
+ attach(sel);
+ }
+ focus(sel);
+ arrange();
+}
diff -r 6b661b78577b -r bd1cd641f2a7 dwm.suckless.org/patches/push.md
--- a/dwm.suckless.org/patches/push.md Mon Sep 07 20:32:23 2009 +0100
+++ b/dwm.suckless.org/patches/push.md Tue Sep 08 16:55:54 2009 +0200
_AT_@ -2,15 +2,15 @@
## Description
-This patch provides a way to move clients position inside the clients list.
+`pushup` and `pushdown` provide a way to move clients inside the clients list.
- #include "push-5.6.c"
-
- { MODKEY|ControlMask, XK_j, pushdown, {0} },
- { MODKEY|ControlMask, XK_k, pushup, {0} },
+ #include "push.c"
+
+ static Key keys[] = {
+ ...
+ { MODKEY|ControlMask, XK_j, pushdown, {0} },
+ { MODKEY|ControlMask, XK_k, pushup, {0} },
## Download
- * [push-5.6.c](push-5.6.c) (1K) (20090709)
- * [push-5.3.c](push-5.3.c) (1K) (20090124)
-
+* [push.c](push.c) (dwm 5.6.1) (20090709)
Received on Tue Sep 08 2009 - 16:56:07 CEST