diff -ruN dwm.orig/config.default.h dwm/config.default.h --- dwm.orig/config.default.h 2007-08-26 15:07:44.000000000 +0200 +++ dwm/config.default.h 2007-08-26 15:08:33.000000000 +0200 @@ -26,11 +26,14 @@ /* layout(s) */ #include "tile.h" +#include "fibonacci.h" #define LAYOUTS \ static Layout layouts[] = { \ /* symbol function */ \ { "[]=", tile }, /* first entry is default */ \ { "><>", floating }, \ + { "(@)", spiral }, \ + { "[\\]", dwindle }, \ }; #define MWFACT 0.6 /* master width factor [0.1 .. 0.9] */ #define SNAP 32 /* snap pixel */ diff -ruN dwm.orig/config.mk dwm/config.mk --- dwm.orig/config.mk 2007-08-26 15:07:44.000000000 +0200 +++ dwm/config.mk 2007-08-26 15:08:33.000000000 +0200 @@ -4,7 +4,7 @@ # Customize below to fit your system # additional layouts beside floating -SRC = tile.c +SRC = tile.c fibonacci.c # paths PREFIX = /usr/local diff -ruN dwm.orig/fibonacci.c dwm/fibonacci.c --- dwm.orig/fibonacci.c 1970-01-01 01:00:00.000000000 +0100 +++ dwm/fibonacci.c 2007-08-26 15:09:31.000000000 +0200 @@ -0,0 +1,67 @@ +/* See LICENSE file for copyright and license details. */ +#include "dwm.h" + +/* static */ + +static void +fibonacci(int shape) { + unsigned int i, n, nx, ny, nw, nh; + Client *c; + + nx = wax; + ny = 0; + nw = waw; + nh = wah; + for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) + n++; + for(i = 0, c = nexttiled(clients); c; c = nexttiled(c->next), i++) { + c->ismax = False; + if((i % 2 && nh / 2 > 2 * c->border) + || (!(i % 2) && nw / 2 > 2 * c->border)) + { + if(i < n - 1) { + if(i % 2) + nh /= 2; + else + nw /= 2; + if((i % 4) == 2 && !shape) + nx += nw; + else if((i % 4) == 3 && !shape) + ny += nh; + } + if((i % 4) == 0) { + if(shape) + ny += nh; + else + ny -= nh; + } + else if((i % 4) == 1) + nx += nw; + else if((i % 4) == 2) + ny += nh; + else if((i % 4) == 3) { + if(shape) + nx += nw; + else + nx -= nw; + } + if(i == 0) + ny = way; + } + resize(c, nx, ny, nw - 2 * c->border, nh - 2 * c->border, False); + } + focus(NULL); + restack(); +} + +/* extern */ + +void +dwindle(void) { + fibonacci(1); +} + +void +spiral(void) { + fibonacci(0); +} diff -ruN dwm.orig/fibonacci.h dwm/fibonacci.h --- dwm.orig/fibonacci.h 1970-01-01 01:00:00.000000000 +0100 +++ dwm/fibonacci.h 2007-08-26 15:08:33.000000000 +0200 @@ -0,0 +1,3 @@ +/* fibonacci.c */ +void dwindle(void); /* arranges all windows in a fibonacci diagonal */ +void spiral(void); /* arranges all windows in a fibonacci spiral */ diff -ruN dwm.orig/tile.c dwm/tile.c --- dwm.orig/tile.c 2007-08-26 15:07:44.000000000 +0200 +++ dwm/tile.c 2007-08-26 15:08:33.000000000 +0200 @@ -73,7 +73,8 @@ zoom(const char *arg) { Client *c; - if(!sel || !isarrange(tile) || sel->isfloating) + if(!sel || (!isarrange(tile) && !isarrange(spiral) && !isarrange(dwindle)) + || sel->isfloating) return; if((c = sel) == nexttiled(clients)) if(!(c = nexttiled(c->next)))