dwm-focusvisibletagstacks-6.5.diff (2102B)
1 diff -up dwm-a/config.def.h dwm-b/config.def.h 2 --- dwm-a/config.def.h 2024-03-23 15:14:00.173450954 +0100 3 +++ dwm-b/config.def.h 2024-03-23 15:35:38.200217214 +0100 4 @@ -65,7 +65,7 @@ static const Key keys[] = { 5 { MODKEY, XK_p, spawn, {.v = dmenucmd } }, 6 { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } }, 7 { MODKEY, XK_b, togglebar, {0} }, 8 - { MODKEY, XK_j, focusstack, {.i = +1 } }, 9 + { MODKEY, XK_j, focusvisibletagstacks,{.i = +1 } }, 10 { MODKEY, XK_k, focusstack, {.i = -1 } }, 11 { MODKEY, XK_i, incnmaster, {.i = +1 } }, 12 { MODKEY, XK_d, incnmaster, {.i = -1 } }, 13 Only in dwm-b: config.h 14 Only in dwm-b: drw.o 15 Only in dwm-b: dwm 16 diff -up dwm-a/dwm.c dwm-b/dwm.c 17 --- dwm-a/dwm.c 2024-03-23 15:14:00.173450954 +0100 18 +++ dwm-b/dwm.c 2024-03-23 16:22:58.729308679 +0100 19 @@ -168,6 +168,7 @@ static void expose(XEvent *e); 20 static void focus(Client *c); 21 static void focusin(XEvent *e); 22 static void focusmon(const Arg *arg); 23 +static void focusvisibletagstacks(const Arg *arg); 24 static void focusstack(const Arg *arg); 25 static Atom getatomprop(Client *c, Atom prop); 26 static int getrootptr(int *x, int *y); 27 @@ -835,6 +836,27 @@ focusmon(const Arg *arg) 28 focus(NULL); 29 } 30 31 +/* loops through all the open windows on the visible tags of all the monitors */ 32 +/* the Arguments sets the direction for the monitors to loop through */ 33 +void 34 +focusvisibletagstacks(const Arg *arg) 35 +{ 36 + Client *c = NULL; 37 + Monitor *beginm = selmon; 38 + if (selmon->sel) { 39 + if (selmon->sel->isfullscreen && lockfullscreen) return; 40 + for (c = selmon->sel->next; c && !ISVISIBLE(c); c = c->next); 41 + } 42 + if (!c) { 43 + do { 44 + focusmon(arg); 45 + } 46 + while(!selmon->clients && selmon != beginm); //focus next monitor with clients 47 + for (c = selmon->clients; c && !ISVISIBLE(c); c = c->next); 48 + } 49 + focus(c); 50 +} 51 + 52 void 53 focusstack(const Arg *arg) 54 { 55 Only in dwm-b: dwm.o 56 Only in dwm-b: util.o