2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
10 /********** CUSTOMIZE **********/
13 [Tscratch] = "scratch",
19 static Rule rule[] = {
20 /* class instance tags isfloat */
21 { "Firefox-bin", "Gecko", { [Twww] = "www" }, False },
24 /********** CUSTOMIZE **********/
26 /* extern functions */
28 void (*arrange)(Arg *) = dotile;
36 sel->tags[arg->i] = tags[arg->i];
46 for(c = clients; c; c = c->next) {
52 if(sel && !sel->tags[tsel]) {
53 if((sel = getnext(clients))) {
69 for(n = 0, c = clients; c; c = c->next)
70 if(c->tags[tsel] && !c->isfloat)
74 h = (sh - bh) / (n - 1);
78 for(i = 0, c = clients; c; c = c->next) {
88 c->w = sw - 2 * c->border;
89 c->h = sh - 2 * c->border - bh;
94 c->w = mw - 2 * c->border;
95 c->h = sh - 2 * c->border - bh;
99 c->y = sy + (i - 1) * h + bh;
100 c->w = w - 2 * c->border;
101 c->h = h - 2 * c->border;
109 if(!sel || (sel && !sel->tags[tsel])) {
110 if((sel = getnext(clients))) {
121 for(; c && !c->tags[tsel]; c = c->next);
132 for(i = 0; i < TLast; i++)
141 static unsigned int len = rule ? sizeof(rule) / sizeof(rule[0]) : 0;
143 Bool matched = False;
146 c->tags[tsel] = tags[tsel];
150 if(XGetClassHint(dpy, c->win, &ch)) {
151 if(ch.res_class && ch.res_name) {
152 for(i = 0; i < len; i++)
153 if(!strncmp(rule[i].class, ch.res_class, sizeof(rule[i].class))
154 && !strncmp(rule[i].instance, ch.res_name, sizeof(rule[i].instance)))
156 for(j = 0; j < TLast; j++)
157 c->tags[j] = rule[i].tags[j];
158 c->isfloat = rule[i].isfloat;
170 c->tags[tsel] = tags[tsel];