mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
23 lines
483 B
C
23 lines
483 B
C
|
static unsigned int scratchtag = 1 << LENGTH(tags);
|
||
|
|
||
|
void
|
||
|
togglescratch(const Arg *arg)
|
||
|
{
|
||
|
Client *c;
|
||
|
unsigned int found = 0;
|
||
|
|
||
|
for (c = selmon->clients; c && !(found = c->tags & scratchtag); c = c->next);
|
||
|
if (found) {
|
||
|
unsigned int newtagset = selmon->tagset[selmon->seltags] ^ scratchtag;
|
||
|
if (newtagset) {
|
||
|
selmon->tagset[selmon->seltags] = newtagset;
|
||
|
focus(NULL);
|
||
|
arrange(selmon);
|
||
|
}
|
||
|
if (ISVISIBLE(c)) {
|
||
|
focus(c);
|
||
|
restack(selmon);
|
||
|
}
|
||
|
} else
|
||
|
spawn(arg);
|
||
|
}
|