diff -r 795c26a59016 config.default.h --- a/config.default.h Sun Aug 26 12:54:20 2007 +0200 +++ b/config.default.h Wed Sep 05 15:51:26 2007 -0400 @@ -12,6 +12,7 @@ #define SELFGCOLOR "#ffffff" /* tagging */ +#define NTAGS 9 #define TAGS \ const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", NULL }; /* Query class:instance:title for regex matching info with following command: diff -r 795c26a59016 tile.c --- a/tile.c Sun Aug 26 12:54:20 2007 +0200 +++ b/tile.c Wed Sep 05 15:51:26 2007 -0400 @@ -1,31 +1,36 @@ /* See LICENSE file for copyright and license details. */ #include "dwm.h" #include - /* static */ -static double mwfact = MWFACT; +static double mwfact[NTAGS]; +static int init = 0; /* extern */ void setmwfact(const char *arg) { double delta; + int i; if(!isarrange(tile)) return; + /* arg handling, manipulate mwfact */ + for(i = 0; i < ntags; i++) + if(seltags[i]) break; + if(arg == NULL) - mwfact = MWFACT; + mwfact[i] = MWFACT; else if(1 == sscanf(arg, "%lf", &delta)) { if(arg[0] != '+' && arg[0] != '-') - mwfact = delta; + mwfact[i] = delta; else - mwfact += delta; - if(mwfact < 0.1) - mwfact = 0.1; - else if(mwfact > 0.9) - mwfact = 0.9; + mwfact[i] += delta; + if(mwfact[i] < 0.1) + mwfact[i] = 0.1; + else if(mwfact[i] > 0.9) + mwfact[i] = 0.9; } arrange(); } @@ -35,11 +40,17 @@ tile(void) { unsigned int i, n, nx, ny, nw, nh, mw, th; Client *c; + if(!init++) + for(i = 0; i < ntags; i++) + mwfact[i] = MWFACT; + for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) n++; + for(i = 0; i < ntags; i++) + if(seltags[i]) break; /* window geoms */ - mw = (n == 1) ? waw : mwfact * waw; + mw = (n == 1) ? waw : mwfact[i] * waw; th = (n > 1) ? wah / (n - 1) : 0; if(n > 1 && th < bh) th = wah;