sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit a005c556b01c965c57dc13f75d6b9c2acdad2228
parent c86420ac64b75f07365d77bf199307a7245a68b7
Author: Jan Christoph Ebersbach <jceb@e-jc.de>
Date:   Sun,  9 Feb 2014 19:52:23 +0100

update gapless grid patch

Diffstat:
Adwm.suckless.org/patches/dwm-6.1-gaplessgrid.diff | 43+++++++++++++++++++++++++++++++++++++++++++
Mdwm.suckless.org/patches/gapless_grid.md | 1+
2 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/dwm.suckless.org/patches/dwm-6.1-gaplessgrid.diff b/dwm.suckless.org/patches/dwm-6.1-gaplessgrid.diff @@ -0,0 +1,43 @@ +URL: http://dwm.suckless.org/patches/gapless_grid +Add gapless grid layout. + +Index: dwm/gaplessgrid.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ dwm/gaplessgrid.c 2014-02-09 15:24:17.132117105 +0100 +@@ -0,0 +1,35 @@ ++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 --git a/dwm.suckless.org/patches/gapless_grid.md b/dwm.suckless.org/patches/gapless_grid.md @@ -26,6 +26,7 @@ Download `gaplessgrid.c` and add the gapless layout to your `config.h`: ## Download +* [dwm-6.1-gaplessgrid.diff](dwm-6.1-gaplessgrid.diff) (1180b) (20140209) * [gaplessgrid.c](gaplessgrid.c) (dwm 5.6.1) (20090908) * [dwm-r1437-gaplessgrid.diff](historical/dwm-r1437-gaplessgrid.diff) (1.9k) (20090704) * [dwm-5.2-gaplessgrid.diff](historical/dwm-5.2-gaplessgrid.diff) (1.9k) (20081020)