Xinqi Bao's Git
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", "firefox-bin", { [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
) {
53 if(sel
&& !sel
->tags
[tsel
]) {
54 if((sel
= getnext(clients
, tsel
))) {
70 for(n
= 0, c
= clients
; c
; c
= c
->next
)
71 if(c
->tags
[tsel
] && !c
->isfloat
)
75 h
= (sh
- bh
) / (n
- 1);
79 for(i
= 0, c
= clients
; c
; c
= c
->next
) {
90 *c
->w
= sw
- 2 * c
->border
;
91 *c
->h
= sh
- 2 * c
->border
- bh
;
96 *c
->w
= mw
- 2 * c
->border
;
97 *c
->h
= sh
- 2 * c
->border
- bh
;
101 *c
->y
= sy
+ (i
- 1) * h
+ bh
;
102 *c
->w
= w
- 2 * c
->border
;
103 *c
->h
= h
- 2 * c
->border
;
111 if(!sel
|| (sel
&& !sel
->tags
[tsel
])) {
112 if((sel
= getnext(clients
, tsel
))) {
121 getnext(Client
*c
, unsigned int t
)
123 for(; c
&& !c
->tags
[t
]; c
= c
->next
);
136 if(!(c
= getnext(clients
, arg
->i
)))
139 for(i
= 0; i
< TLast
; i
++)
141 c
->tags
[tsel
] = tags
[tsel
];
153 for(i
= 0; i
< TLast
; i
++)
162 static unsigned int len
= rule
? sizeof(rule
) / sizeof(rule
[0]) : 0;
164 Bool matched
= False
;
167 c
->tags
[tsel
] = tags
[tsel
];
171 if(XGetClassHint(dpy
, c
->win
, &ch
)) {
172 if(ch
.res_class
&& ch
.res_name
) {
173 for(i
= 0; i
< len
; i
++)
174 if(!strncmp(rule
[i
].class, ch
.res_class
, sizeof(rule
[i
].class))
175 && !strncmp(rule
[i
].instance
, ch
.res_name
, sizeof(rule
[i
].instance
)))
177 for(j
= 0; j
< TLast
; j
++)
178 c
->tags
[j
] = rule
[i
].tags
[j
];
179 c
->isfloat
= rule
[i
].isfloat
;
191 c
->tags
[tsel
] = tags
[tsel
];