summaryrefslogtreecommitdiff
path: root/dwm/patch/tagothermonitor.c
diff options
context:
space:
mode:
authorcoasteen <coasteen@proton.me>2026-07-09 10:42:28 +0330
committercoasteen <coasteen@proton.me>2026-07-09 10:42:28 +0330
commit8cbadb61604667b407b53ee1258433994fa4765a (patch)
tree97765fb29418fd6278fcb4cbb9760893afaf7a58 /dwm/patch/tagothermonitor.c
Diffstat (limited to 'dwm/patch/tagothermonitor.c')
-rwxr-xr-xdwm/patch/tagothermonitor.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/dwm/patch/tagothermonitor.c b/dwm/patch/tagothermonitor.c
new file mode 100755
index 0000000..90739dc
--- /dev/null
+++ b/dwm/patch/tagothermonitor.c
@@ -0,0 +1,44 @@
+#if IPC_PATCH || DWMC_PATCH
+void
+tagnextmonex(const Arg *arg)
+{
+ tagnextmon(&((Arg) { .ui = 1 << arg->ui }));
+}
+
+void
+tagprevmonex(const Arg *arg)
+{
+ tagprevmon(&((Arg) { .ui = 1 << arg->ui }));
+}
+#endif // IPC_PATCH | DWMC_PATCH
+
+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;
+ arrange(newmon);
+ focus(NULL);
+ }
+}
+