[wiki] [sites] Cycling through windows on multi monitors || Wim Stockman
commit c4f6cb621990a73200ae554edcf92fc003f19700
Author: Wim Stockman <wim_AT_thinkerwim.org>
Date: Sat Mar 23 16:47:55 2024 +0100
Cycling through windows on multi monitors
diff --git a/dwm.suckless.org/patches/focusvisibletagstacks/dwm-focusvisibletagstacks-6.5.diff b/dwm.suckless.org/patches/focusvisibletagstacks/dwm-focusvisibletagstacks-6.5.diff
new file mode 100644
index 00000000..0a4ac012
--- /dev/null
+++ b/dwm.suckless.org/patches/focusvisibletagstacks/dwm-focusvisibletagstacks-6.5.diff
_AT_@ -0,0 +1,56 @@
+diff -up dwm-a/config.def.h dwm-b/config.def.h
+--- dwm-a/config.def.h 2024-03-23 15:14:00.173450954 +0100
++++ dwm-b/config.def.h 2024-03-23 15:35:38.200217214 +0100
+_AT_@ -65,7 +65,7 @@ static const Key keys[] = {
+ { MODKEY, XK_p, spawn, {.v = dmenucmd } },
+ { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
+ { MODKEY, XK_b, togglebar, {0} },
+- { MODKEY, XK_j, focusstack, {.i = +1 } },
++ { MODKEY, XK_j, focusvisibletagstacks,{.i = +1 } },
+ { MODKEY, XK_k, focusstack, {.i = -1 } },
+ { MODKEY, XK_i, incnmaster, {.i = +1 } },
+ { MODKEY, XK_d, incnmaster, {.i = -1 } },
+Only in dwm-b: config.h
+Only in dwm-b: drw.o
+Only in dwm-b: dwm
+diff -up dwm-a/dwm.c dwm-b/dwm.c
+--- dwm-a/dwm.c 2024-03-23 15:14:00.173450954 +0100
++++ dwm-b/dwm.c 2024-03-23 16:22:58.729308679 +0100
+_AT_@ -168,6 +168,7 @@ static void expose(XEvent *e);
+ static void focus(Client *c);
+ static void focusin(XEvent *e);
+ static void focusmon(const Arg *arg);
++static void focusvisibletagstacks(const Arg *arg);
+ static void focusstack(const Arg *arg);
+ static Atom getatomprop(Client *c, Atom prop);
+ static int getrootptr(int *x, int *y);
+_AT_@ -835,6 +836,27 @@ focusmon(const Arg *arg)
+ focus(NULL);
+ }
+
++/* loops through all the open windows on the visible tags of all the monitors */
++/* the Arguments sets the direction for the monitors to loop through */
++void
++focusvisibletagstacks(const Arg *arg)
++{
++ Client *c = NULL;
++ Monitor *beginm = selmon;
++ if (selmon->sel) {
++ if (selmon->sel->isfullscreen && lockfullscreen) return;
++ for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next);
++ }
++ if (!c) {
++ do {
++ focusmon(arg);
++ }
++ while(!selmon->clients && selmon != beginm); //focus next monitor with clients
++ for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next);
++ }
++ focus(c);
++}
++
+ void
+ focusstack(const Arg *arg)
+ {
+Only in dwm-b: dwm.o
+Only in dwm-b: util.o
diff --git a/dwm.suckless.org/patches/focusvisibletagstacks/index.md b/dwm.suckless.org/patches/focusvisibletagstacks/index.md
new file mode 100644
index 00000000..cd5e9b06
--- /dev/null
+++ b/dwm.suckless.org/patches/focusvisibletagstacks/index.md
_AT_@ -0,0 +1,23 @@
+Focus Visible Tags Stacks
+=========================
+
+Description
+-----------
+This patch allow to cycle throught all open windows on all your monitors
+and setting the focus to it.
+Like the default focusstack but at the end of the stack it sets the focus on the next monitor that has windows.
+
+Optional you can set the direction with .i = +1 or .i =-1
+
+Default keybinding
+-------------------
+* `Mod+j`
+
+
+Download
+--------
+* [dwm-focusvisibletagstacks-6.5.diff](dwm-focusvisibletagstacks-6.5.diff)
+
+Author
+------
+* Wim Stockman - <wim [at] thinkerwim [dot] org>
Received on Sat Mar 23 2024 - 16:48:31 CET
This archive was generated by hypermail 2.3.0
: Sat Mar 23 2024 - 16:48:54 CET