--- .pvc//leaf/14192b8f/0-pancake@localhost 2007-08-26 15:05:47.000000000 +0200 +++ .pvc/leaf/14192b8f/1-pancake@localhost 2007-08-26 15:15:58.000000000 +0200 @@ -383,3 +383,11 @@ if(!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name)) gettextprop(c->win, wmatom[WMName], c->name, sizeof c->name); } + +void clientspertag(const char *arg) { + if (arg[0]=='^') { + if (cpt==-1) cpt = atoi(arg+1); + else cpt = -1; + } else cpt = atoi(arg); + arrange(); +} --- .pvc//leaf/8342ea84/0-pancake@localhost 2007-08-26 15:05:47.000000000 +0200 +++ .pvc/leaf/8342ea84/1-pancake@localhost 2007-08-26 15:15:58.000000000 +0200 @@ -16,7 +16,7 @@ /* extern */ char stext[256]; -int screen, sx, sy, sw, sh, wax, way, waw, wah; +int screen, sx, sy, sw, sh, wax, way, waw, wah, cpt; unsigned int bh, ntags; unsigned int bpos = BARPOS; unsigned int numlockmask = 0; @@ -209,6 +209,7 @@ sx = sy = 0; sw = DisplayWidth(dpy, screen); sh = DisplayHeight(dpy, screen); + cpt = -1; initlayouts(); /* bar */ dc.h = bh = dc.font.height + 2; --- .pvc//leaf/92639dee/0-pancake@localhost 2007-08-26 15:05:47.000000000 +0200 +++ .pvc/leaf/92639dee/1-pancake@localhost 2007-08-26 15:15:58.000000000 +0200 @@ -58,6 +58,7 @@ for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) n++; + if (cpt!=-1 && n>cpt) n = cpt; /* window geoms */ mh = (n <= nmaster) ? wah / (n > 0 ? n : 1) : wah / nmaster; @@ -69,6 +70,10 @@ nx = wax; ny = way; for(i = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) { + if (cpt!=-1 && i>=cpt) { + ban(c); + continue; + } c->ismax = False; if(i < nmaster) { /* master */ ny = way + i * mh; @@ -103,6 +108,7 @@ for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) n++; + if (cpt!=-1 && n>cpt) n = cpt; /* window geoms */ mh = (n > 1) ? (wah * mwfact) / 1 : wah / (n > 0 ? n : 1); @@ -111,6 +117,10 @@ tw = (n > 1) ? waw / (n - 1) : 0; for(i = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) { + if (cpt!=-1 && i>=cpt) { + ban(c); + continue; + } c->ismax = False; nx = wax; ny = way; --- .pvc//leaf/ea32c25a/0-pancake@localhost 2007-08-26 15:05:47.000000000 +0200 +++ .pvc/leaf/ea32c25a/1-pancake@localhost 2007-08-26 15:15:58.000000000 +0200 @@ -76,8 +76,10 @@ { MODKEY|ShiftMask, XK_space, togglefloating, NULL }, \ { MODKEY, XK_space, setlayout, NULL }, \ { MODKEY, XK_b, togglebar, NULL }, \ - { MODKEY|ShiftMask, XK_j, incnmaster, "-1" }, \ - { MODKEY|ShiftMask, XK_k, incnmaster, "+1" }, \ + { MODKEY, XK_w, clientspertag, "^2" }, \ + { MODKEY|ShiftMask, XK_w, clientspertag, "^0" }, \ + { MODKEY|ShiftMask, XK_j, incnmaster, "+1" }, \ + { MODKEY|ShiftMask, XK_k, incnmaster, "-1" }, \ { MODKEY, XK_j, focusnext, NULL }, \ { MODKEY, XK_k, focusprev, NULL }, \ { MODKEY, XK_h, setmwfact, "-.1" }, \ --- .pvc//leaf/d09403e6/0-pancake@localhost 2007-08-26 15:05:47.000000000 +0200 +++ .pvc/leaf/d09403e6/1-pancake@localhost 2007-08-26 15:15:59.000000000 +0200 @@ -77,6 +77,7 @@ extern char stext[256]; /* status text */ extern int screen, sx, sy, sw, sh; /* screen geometry */ extern int wax, way, wah, waw; /* windowarea geometry */ +extern int cpt; /* clients per tag limit */ extern unsigned int bh, blw, bpos; /* bar height, bar layout label width, bar position */ extern unsigned int ntags, numlockmask; /* number of tags, numlock mask */ extern void (*handler[LASTEvent])(XEvent *); /* event handler */ @@ -144,3 +145,4 @@ void *emallocz(unsigned int size); /* allocates zero-initialized memory, exits on error */ void eprint(const char *errstr, ...); /* prints errstr and exits with 1 */ void spawn(const char *arg); /* forks a new subprocess with arg's cmd */ +void clientspertag(const char *arg); /* limit number of clients per tag */