summaryrefslogtreecommitdiffhomepage
path: root/patch
diff options
context:
space:
mode:
authorStein Gunnar Bakkeby <[email protected]>2020-06-21 08:21:16 +0200
committerGitHub <[email protected]>2020-06-21 08:21:16 +0200
commitf27195491c56fe53c75942236077c4152176a582 (patch)
tree8ebcc31c606fbb6ec54ba8f164a5118ee6c56573 /patch
parent5e0a9c49f8d4f70616282b50bead1efcbcc20e94 (diff)
parent6aca08966183c9ec6bce8a6f346b48a79b30fc1e (diff)
downloaddwm-flexipatch-f27195491c56fe53c75942236077c4152176a582.tar.gz
dwm-flexipatch-f27195491c56fe53c75942236077c4152176a582.zip
Merge pull request #32 from gx2b/master
Adding tagothermonitor patch
Diffstat (limited to 'patch')
-rw-r--r--patch/dwmc.c16
-rw-r--r--patch/dwmc.h6
-rw-r--r--patch/include.c5
-rw-r--r--patch/include.h5
-rw-r--r--patch/tagothermonitor.c29
-rw-r--r--patch/tagothermonitor.h3
6 files changed, 60 insertions, 4 deletions
diff --git a/patch/dwmc.c b/patch/dwmc.c
index 8b62cda..5b1c5e4 100644
--- a/patch/dwmc.c
+++ b/patch/dwmc.c
@@ -40,6 +40,20 @@ tagallex(const Arg *arg)
tag(&((Arg){.ui = ~0}));
}
+#if TAGOTHERMONITOR_PATCH
+void
+tagnextmonex(const Arg *arg)
+{
+ tagnextmon(&((Arg) { .ui = 1 << arg->ui }));
+}
+
+void
+tagprevmonex(const Arg *arg)
+{
+ tagprevmon(&((Arg) { .ui = 1 << arg->ui }));
+}
+#endif
+
int
fake_signal(void)
{
@@ -81,4 +95,4 @@ fake_signal(void)
// No fake signal was sent, so proceed with update
return 0;
-} \ No newline at end of file
+}
diff --git a/patch/dwmc.h b/patch/dwmc.h
index 1711081..c30cdaf 100644
--- a/patch/dwmc.h
+++ b/patch/dwmc.h
@@ -10,4 +10,8 @@ static void toggleviewex(const Arg *arg);
static void tagex(const Arg *arg);
static void toggletagex(const Arg *arg);
static void tagallex(const Arg *arg);
-static int fake_signal(void); \ No newline at end of file
+#if TAGOTHERMONITOR_PATCH
+static void tagnextmonex(const Arg *arg);
+static void tagprevmonex(const Arg *arg);
+#endif
+static int fake_signal(void);
diff --git a/patch/include.c b/patch/include.c
index 77abf89..47136f2 100644
--- a/patch/include.c
+++ b/patch/include.c
@@ -164,6 +164,9 @@
#if TAGGRID_PATCH
#include "taggrid.c"
#endif
+#if TAGOTHERMONITOR_PATCH
+#include "tagothermonitor.c"
+#endif
#if TAGSWAPMON_PATCH
#include "tagswapmon.c"
#endif
@@ -245,4 +248,4 @@
#endif
#if TILE_LAYOUT
#include "tile.c"
-#endif \ No newline at end of file
+#endif
diff --git a/patch/include.h b/patch/include.h
index 93442f1..dca2120 100644
--- a/patch/include.h
+++ b/patch/include.h
@@ -164,6 +164,9 @@
#if TAGGRID_PATCH
#include "taggrid.h"
#endif
+#if TAGOTHERMONITOR_PATCH
+#include "tagothermonitor.h"
+#endif
#if TAGSWAPMON_PATCH
#include "tagswapmon.h"
#endif
@@ -239,4 +242,4 @@
#endif
#if TILE_LAYOUT
#include "tile.h"
-#endif \ No newline at end of file
+#endif
diff --git a/patch/tagothermonitor.c b/patch/tagothermonitor.c
new file mode 100644
index 0000000..6f39212
--- /dev/null
+++ b/patch/tagothermonitor.c
@@ -0,0 +1,29 @@
+void
+tagnextmon(const Arg *arg)
+{
+ tagothermon(arg, 1);
+}
+
+void
+tagprevmon(const Arg *arg)
+{
+ tagothermon(arg, -1);
+}
+
+void
+tagothermon(const Arg *arg, int dir)
+{
+ Client *sel;
+ Monitor *newmon;
+
+ if (!selmon->sel || !mons->next)
+ return;
+ sel = selmon->sel;
+ newmon = dirtomon(dir);
+ sendmon(sel, newmon);
+ if (arg->ui & TAGMASK) {
+ sel->tags = arg->ui & TAGMASK;
+ focus(NULL);
+ arrange(newmon);
+ }
+}
diff --git a/patch/tagothermonitor.h b/patch/tagothermonitor.h
new file mode 100644
index 0000000..44258bc
--- /dev/null
+++ b/patch/tagothermonitor.h
@@ -0,0 +1,3 @@
+static void tagnextmon(const Arg *arg);
+static void tagprevmon(const Arg *arg);
+static void tagothermon(const Arg *arg, int dir);