--- config.arg.h Sun Aug 12 05:19:58 2007 +++ config.arg.h Sun Aug 12 04:45:43 2007 @@ -30,6 +30,7 @@ static Layout layout[] = { \ /* symbol function */ \ { "[]=", tile }, /* first entry is default */ \ { "><>", floating }, \ + { "TTT", bstack }, \ }; #define MWFACT 0.6 /* master width factor [0.1 .. 0.9] */ #define SNAP 32 /* snap pixel */ --- config.default.h Sun Aug 12 05:19:58 2007 +++ config.default.h Sun Aug 12 04:45:57 2007 @@ -31,6 +31,7 @@ static Layout layout[] = { \ /* symbol function */ \ { "[]=", tile }, /* first entry is default */ \ { "><>", floating }, \ + { "TTT", bstack }, \ }; #define MWFACT 0.6 /* master width factor [0.1 .. 0.9] */ #define SNAP 32 /* snap pixel */ --- tile.c Sun Aug 12 05:19:58 2007 +++ tile.c Sun Aug 12 05:20:19 2007 @@ -12,7 +12,7 @@ void addtomwfact(const char *arg) { double delta; - if(lt->arrange != tile) + if(lt->arrange == floating) return; /* arg handling, manipulate mwfact */ @@ -63,6 +63,53 @@ tile(void) { resize(c, nx, ny, nw, nh, False); if(n > 1 && th != wah) ny += nh + 2 * c->border; + i++; + } + else + ban(c); + focus(NULL); + restack(); +} + +void +bstack(void) { + unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th; + Client *c; + + for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) + n++; + + /* window geoms */ + mh = (n > 1) ? (wah * mwfact) / 1 : wah / (n > 0 ? n : 1); + mw = waw; + th = (n > 1) ? (wah * (1 - mwfact)) / 1 : 0; + tw = (n > 1) ? waw / (n - 1) : 0; + + for(i = 0, c = clients; c; c = c->next) + if(isvisible(c)) { + unban(c); + if(c->isfloating) + continue; + c->ismax = False; + nx = wax; + ny = way; + if(i < 1) { + ny += i * mh; + nw = mw - 2 * c->border; + nh = mh - 2 * c->border; + } + else { + nx += (i - 1) * tw; + ny += mh * 1; + if(i + 1 == n) { /* remainder */ + nw = (wax + waw) - nx - 2 * c->border; + } + else { + nw = tw - 2 * c->border; + } + nh = th - 2 * c->border + 1; + } + resize(c, nx, ny, nw, nh, False); i++; } else --- tile.h Sun Aug 12 05:19:58 2007 +++ tile.h Sun Aug 12 04:46:33 2007 @@ -3,4 +3,5 @@ /* tile.c */ void addtomwfact(const char *arg); /* adds arg value [0.1 .. 0.9] to master width factor */ void tile(void); /* arranges all windows tiled */ +void bstack(void); /* arranges all windows bottom stacked */ void zoom(const char *arg); /* zooms the focused client to master area, arg is ignored */