summaryrefslogtreecommitdiffhomepage
path: root/patch/scratchpad.c
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2019-10-10 23:33:04 +0200
committerbakkeby <[email protected]>2019-10-10 23:33:04 +0200
commit2eb8bcdf153d608caf1e23817b463fd03cc44b72 (patch)
tree3beb8b5ea556c2788b58fe4a15882686a8e40f9a /patch/scratchpad.c
parented1c509df3faf757a5b46bae0cfa59035977b50c (diff)
downloaddwm-flexipatch-2eb8bcdf153d608caf1e23817b463fd03cc44b72.tar.gz
dwm-flexipatch-2eb8bcdf153d608caf1e23817b463fd03cc44b72.zip
Adding scratchpad patch
Diffstat (limited to 'patch/scratchpad.c')
-rw-r--r--patch/scratchpad.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/patch/scratchpad.c b/patch/scratchpad.c
new file mode 100644
index 0000000..7ba6366
--- /dev/null
+++ b/patch/scratchpad.c
@@ -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);
+} \ No newline at end of file