commit b3b1062ef609ada0a0b62de15c93716ce549ec4e
Author: Wim Stockman <[email protected]>
Date:   Thu Nov 21 15:49:15 2024 +0100

    Add a cycletags patch, to cycle through your tags

diff --git 
a/dwm.suckless.org/patches/cycleview/dwm-cycletags-20241121-0a129d5f.diff 
b/dwm.suckless.org/patches/cycleview/dwm-cycletags-20241121-0a129d5f.diff
new file mode 100644
index 00000000..734a6af0
--- /dev/null
+++ b/dwm.suckless.org/patches/cycleview/dwm-cycletags-20241121-0a129d5f.diff
@@ -0,0 +1,61 @@
+From 0a129d5ff1b94cf29d0896e9b47a3bc08d6a95fc Mon Sep 17 00:00:00 2001
+From: Wim Stockman <[email protected]>
+Date: Thu, 21 Nov 2024 15:37:49 +0100
+Subject: [PATCH] A patch that loops through all tags on a moniter in both
+ directions
+
+---
+ config.def.h |  2 ++
+ dwm.c        | 16 ++++++++++++++++
+ 2 files changed, 18 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index 9efa774..04bb388 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -67,6 +67,8 @@ static const Key keys[] = {
+       { MODKEY,                       XK_b,      togglebar,      {0} },
+       { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
+       { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
++      { MODKEY|ShiftMask,             XK_j,      cycleview,      {1} },
++      { MODKEY|ShiftMask,             XK_k,      cycleview,      {0} },
+       { MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
+       { MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
+       { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} 
},
+diff --git a/dwm.c b/dwm.c
+index 1443802..2014518 100644
+--- a/dwm.c
++++ b/dwm.c
+@@ -226,6 +226,7 @@ static void updatetitle(Client *c);
+ static void updatewindowtype(Client *c);
+ static void updatewmhints(Client *c);
+ static void view(const Arg *arg);
++static void cycleview(const Arg *arg);
+ static Client *wintoclient(Window w);
+ static Monitor *wintomon(Window w);
+ static int xerror(Display *dpy, XErrorEvent *ee);
+@@ -2049,6 +2050,21 @@ updatewmhints(Client *c)
+       }
+ }
+ 
++void
++cycleview(const Arg *arg) {
++       unsigned int newtag ;
++      if (arg->ui) { /* if ui is 1 goto the left if 0 goto the right */
++          newtag = selmon->tagset[selmon->seltags] >> 1;
++          if (newtag == 0) newtag = (1 << (LENGTH(tags) - 1));
++      }
++      else{
++          newtag = selmon->tagset[selmon->seltags] << 1;
++          if (newtag > ( 1 << (LENGTH(tags) - 1))) newtag = 1;
++      }
++    Arg a = { .ui = newtag};
++    view(&a);
++}
++
+ void
+ view(const Arg *arg)
+ {
+-- 
+2.47.0
+
diff --git a/dwm.suckless.org/patches/cycleview/index.md 
b/dwm.suckless.org/patches/cycleview/index.md
new file mode 100644
index 00000000..08e1ffbc
--- /dev/null
+++ b/dwm.suckless.org/patches/cycleview/index.md
@@ -0,0 +1,22 @@
+Focus Visible Tags Stacks
+=========================
+
+Description
+-----------
+This patch allow to cycle through all the tags of the active monitor
+
+Optional you can set the direction with 0 or 1
+
+Default keybinding
+-------------------
+* `Mod+Shift+j` 
+* `Mod+Shift+k`  
+
+
+Download
+--------
+* [dwm-cycletags-20241121-0a129d5f.diff](dwm-cycletags-20241121-0a129d5f.diff)
+
+Author
+------
+* Wim Stockman - <wim [at] thinkerwim [dot] org>


Reply via email to