Adding scratchpad patch
This commit is contained in:
@@ -94,6 +94,10 @@
|
||||
#include "rotatestack.c"
|
||||
#endif
|
||||
|
||||
#if SCRATCHPAD_PATCH
|
||||
#include "scratchpad.c"
|
||||
#endif
|
||||
|
||||
#if SELFRESTART_PATCH
|
||||
#include "selfrestart.c"
|
||||
#endif
|
||||
|
@@ -94,6 +94,10 @@
|
||||
#include "rotatestack.h"
|
||||
#endif
|
||||
|
||||
#if SCRATCHPAD_PATCH
|
||||
#include "scratchpad.h"
|
||||
#endif
|
||||
|
||||
#if SELFRESTART_PATCH
|
||||
#include "selfrestart.h"
|
||||
#endif
|
||||
|
23
patch/scratchpad.c
Normal file
23
patch/scratchpad.c
Normal file
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
1
patch/scratchpad.h
Normal file
1
patch/scratchpad.h
Normal file
@@ -0,0 +1 @@
|
||||
static void togglescratch(const Arg *arg);
|
Reference in New Issue
Block a user