2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
13 static Rule rule[] = {
14 /* class instance tags isfloat */
15 { "Firefox-bin", "Gecko", { [Twww] = "www" }, False },
22 [Tscratch] = "scratch",
27 void (*arrange)(Arg *) = dotile;
35 sel->tags[arg->i] = tags[arg->i];
45 for(c = clients; c; c = c->next) {
51 if(sel && !sel->tags[tsel]) {
52 if((sel = getnext(clients))) {
68 for(n = 0, c = clients; c; c = c->next)
69 if(c->tags[tsel] && !c->isfloat)
73 h = (sh - bh) / (n - 1);
77 for(i = 0, c = clients; c; c = c->next) {
87 c->w = sw - 2 * c->border;
88 c->h = sh - 2 * c->border - bh;
93 c->w = mw - 2 * c->border;
94 c->h = sh - 2 * c->border - bh;
98 c->y = sy + (i - 1) * h + bh;
99 c->w = w - 2 * c->border;
100 c->h = h - 2 * c->border;
108 if(!sel || (sel && !sel->tags[tsel])) {
109 if((sel = getnext(clients))) {
120 for(; c && !c->tags[tsel]; c = c->next);
131 for(i = 0; i < TLast; i++)
140 static unsigned int len = rule ? sizeof(rule) / sizeof(rule[0]) : 0;
142 Bool matched = False;
145 c->tags[tsel] = tags[tsel];
149 if(XGetClassHint(dpy, c->win, &ch)) {
150 if(ch.res_class && ch.res_name) {
151 for(i = 0; i < len; i++)
152 if(!strncmp(rule[i].class, ch.res_class, sizeof(rule[i].class))
153 && !strncmp(rule[i].instance, ch.res_name, sizeof(rule[i].instance)))
155 for(j = 0; j < TLast; j++)
156 c->tags[j] = rule[i].tags[j];
157 c->isfloat = rule[i].isfloat;
169 c->tags[tsel] = tags[tsel];