--- bstack.c Wed Dec 31 19:00:00 1969 +++ bstack.c Thu Oct 16 18:59:03 2008 @@ -0,0 +1,31 @@ +void +bstack(void) { + int x, y, h, w, mh; + unsigned int i, n; + Client *c; + + for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next), n++); + if(n == 0) + return; + + c = nexttiled(clients); + mh = mfact * wh; + resize(c, wx, wy, ww - 2 * c->bw, (n == 1 ? wh : mh) - 2 * c->bw, resizehints); + + if(--n == 0) + return; + + x = wx; + y = (wy + mh > c->y + c->h) ? c->y + c->h + 2 * c->bw : wy + mh; + w = ww / n; + h = (wy + mh > c->y + c->h) ? wy + wh - y : wh - mh; + if(h < bh) + h = wh; + + for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) { + resize(c, x, y, ((i + 1 == n) ? wx + ww - x : w) - 2 * c->bw, + h - 2 * c->bw, resizehints); + if(w != ww) + x = c->x + WIDTH(c); + } +} --- config.def.h Thu Oct 16 18:58:37 2008 +++ config.def.h Thu Oct 16 18:59:31 2008 @@ -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 "bstack.c" static Layout layouts[] = { /* symbol arrange function */ { "[]=", tile }, /* first entry is default */ { "><>", NULL }, /* no layout function means floating behavior */ { "[M]", monocle }, + { "TTT", bstack }, }; /* key definitions */