summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2019-09-05 23:59:13 +0200
committerbakkeby <[email protected]>2019-09-05 23:59:13 +0200
commitab6eb606576a6fa966145b2066e7e59e6e7903a0 (patch)
tree73691a350f339629c65d1d69bbe71ce353b90efa /patch
parent1d7247ebb5ebb1aabd8a60f7c9eaf965641c4915 (diff)
downloaddwm-flexipatch-ab6eb606576a6fa966145b2066e7e59e6e7903a0.tar.gz
dwm-flexipatch-ab6eb606576a6fa966145b2066e7e59e6e7903a0.zip
Adding tagallmon and tagswapmon patches
Diffstat (limited to 'patch')
-rw-r--r--patch/include.c8
-rw-r--r--patch/include.h8
-rw-r--r--patch/tagallmon.c31
-rw-r--r--patch/tagallmon.h1
-rw-r--r--patch/tagswapmon.c60
-rw-r--r--patch/tagswapmon.h1
6 files changed, 109 insertions, 0 deletions
diff --git a/patch/include.c b/patch/include.c
index aa64108..6308352 100644
--- a/patch/include.c
+++ b/patch/include.c
@@ -10,6 +10,14 @@
#include "systray.c"
#endif
+#if TAGALLMON_PATCH
+#include "tagallmon.c"
+#endif
+
+#if TAGSWAPMON_PATCH
+#include "tagswapmon.c"
+#endif
+
#if TOGGLEFULLSCREEN_PATCH
#include "togglefullscreen.c"
#endif
diff --git a/patch/include.h b/patch/include.h
index 972bd4e..a0e7a4b 100644
--- a/patch/include.h
+++ b/patch/include.h
@@ -6,6 +6,14 @@
#include "systray.h"
#endif
+#if TAGALLMON_PATCH
+#include "tagallmon.h"
+#endif
+
+#if TAGSWAPMON_PATCH
+#include "tagswapmon.h"
+#endif
+
#if TOGGLEFULLSCREEN_PATCH
#include "togglefullscreen.h"
#endif
diff --git a/patch/tagallmon.c b/patch/tagallmon.c
new file mode 100644
index 0000000..51af142
--- /dev/null
+++ b/patch/tagallmon.c
@@ -0,0 +1,31 @@
+void
+tagallmon(const Arg *arg)
+{
+ Monitor *m;
+ Client *c;
+ Client *next;
+
+ if (!mons->next)
+ return;
+
+ m = dirtomon(arg->i);
+ for (c = selmon->clients; c; c = next) {
+ next = c->next;
+ if (!ISVISIBLE(c))
+ continue;
+ unfocus(c, 1);
+ detach(c);
+ detachstack(c);
+ c->mon = m;
+ c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
+ attach(c);
+ attachstack(c);
+ if (c->isfullscreen) {
+ setfullscreen(c, 0);
+ setfullscreen(c, 1);
+ }
+ }
+
+ focus(NULL);
+ arrange(NULL);
+} \ No newline at end of file
diff --git a/patch/tagallmon.h b/patch/tagallmon.h
new file mode 100644
index 0000000..e409024
--- /dev/null
+++ b/patch/tagallmon.h
@@ -0,0 +1 @@
+static void tagallmon(const Arg *arg); \ No newline at end of file
diff --git a/patch/tagswapmon.c b/patch/tagswapmon.c
new file mode 100644
index 0000000..8779262
--- /dev/null
+++ b/patch/tagswapmon.c
@@ -0,0 +1,60 @@
+void
+tagswapmon(const Arg *arg)
+{
+ Monitor *m;
+ Client *c, *sc = NULL, *mc = NULL, *next;
+
+ if (!mons->next)
+ return;
+
+ m = dirtomon(arg->i);
+
+ for (c = selmon->clients; c; c = next) {
+ next = c->next;
+ if (!ISVISIBLE(c))
+ continue;
+ unfocus(c, 1);
+ detach(c);
+ detachstack(c);
+ c->next = sc;
+ sc = c;
+ }
+
+ for (c = m->clients; c; c = next) {
+ next = c->next;
+ if (!ISVISIBLE(c))
+ continue;
+ unfocus(c, 1);
+ detach(c);
+ detachstack(c);
+ c->next = mc;
+ mc = c;
+ }
+
+ for (c = sc; c; c = next) {
+ next = c->next;
+ c->mon = m;
+ c->tags = m->tagset[m->seltags]; /* assign tags of target monitor */
+ attach(c);
+ attachstack(c);
+ if (c->isfullscreen) {
+ setfullscreen(c, 0);
+ setfullscreen(c, 1);
+ }
+ }
+
+ for (c = mc; c; c = next) {
+ next = c->next;
+ c->mon = selmon;
+ c->tags = selmon->tagset[selmon->seltags]; /* assign tags of target monitor */
+ attach(c);
+ attachstack(c);
+ if (c->isfullscreen) {
+ setfullscreen(c, 0);
+ setfullscreen(c, 1);
+ }
+ }
+
+ focus(NULL);
+ arrange(NULL);
+} \ No newline at end of file
diff --git a/patch/tagswapmon.h b/patch/tagswapmon.h
new file mode 100644
index 0000000..433f4b1
--- /dev/null
+++ b/patch/tagswapmon.h
@@ -0,0 +1 @@
+static void tagswapmon(const Arg *arg); \ No newline at end of file