[wiki] [sites] [dwm][patch][throw-to-other-tag] Add a new patch. || Mike S. Stevenson

From: <git_AT_suckless.org>
Date: Fri, 11 Oct 2024 18:31:49 +0200

commit 8fb6c0bca43e2c6297bc500c73c788d3e186885c
Author: Mike S. Stevenson <mikess_AT_disroot.org>
Date: Fri Oct 11 10:28:35 2024 -0600

    [dwm][patch][throw-to-other-tag] Add a new patch.

diff --git a/dwm.suckless.org/patches/throwtoothertag/dwm-throwtoothertag.diff b/dwm.suckless.org/patches/throwtoothertag/dwm-throwtoothertag.diff
new file mode 100644
index 00000000..598a15ac
--- /dev/null
+++ b/dwm.suckless.org/patches/throwtoothertag/dwm-throwtoothertag.diff
_AT_@ -0,0 +1,52 @@
+From bca2e4381ab60a54174bac3c15ba8776740274f3 Mon Sep 17 00:00:00 2001
+From: "Mike S. Stevenson" <mikess_AT_disroot.org>
+Date: Tue, 8 Oct 2024 20:20:29 -0600
+Subject: [PATCH] tag({0}) tags the selected window to the previous tagset.
+
+In the same way that view({0}) toggles between tagsets.
+
+Likewise, tag({0}) shall be bound to mod+shift+tab, corresponding to the
+existing mod+tab binding.
+---
+ config.def.h | 1 +
+ dwm.c | 11 +++++++----
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/config.def.h b/config.def.h
+index 9efa774..97606d7 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -73,6 +73,7 @@ static const Key keys[] = {
+ { MODKEY, XK_l, setmfact, {.f = +0.05} },
+ { MODKEY, XK_Return, zoom, {0} },
+ { MODKEY, XK_Tab, view, {0} },
++ { MODKEY|ShiftMask, XK_Tab, tag, {0} },
+ { MODKEY|ShiftMask, XK_c, killclient, {0} },
+ { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
+ { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
+diff --git a/dwm.c b/dwm.c
+index 2f2b871..a11aa99 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -1669,11 +1669,14 @@ spawn(const Arg *arg)
+ void
+ tag(const Arg *arg)
+ {
+- if (selmon->sel && arg->ui & TAGMASK) {
++ if(!selmon->sel)
++ return;
++ if (arg->ui & TAGMASK)
+ selmon->sel->tags = arg->ui & TAGMASK;
+- focus(NULL);
+- arrange(selmon);
+- }
++ else
++ selmon->sel->tags = selmon->tagset[selmon->seltags ^ 1];
++ focus(NULL);
++ arrange(selmon);
+ }
+
+ void
+--
+2.46.2
+
diff --git a/dwm.suckless.org/patches/throwtoothertag/index.md b/dwm.suckless.org/patches/throwtoothertag/index.md
new file mode 100644
index 00000000..08d04696
--- /dev/null
+++ b/dwm.suckless.org/patches/throwtoothertag/index.md
_AT_@ -0,0 +1,20 @@
+throw to other tag
+------------------
+
+Description
+-----------
+
+Changes the `tag` function so passing {0} sets the tags of the current window
+to whatever the previous tagset was.
+
+It also binds this behavior to mod+shift+tab.
+
+Download
+--------
+
+* [dwm-throwtoothertag.diff](dwm-throwtoothertag.diff)
+
+Author
+------
+
+* Mike S. Stevenson <mikess_AT_disroot.org>
Received on Fri Oct 11 2024 - 18:31:49 CEST

This archive was generated by hypermail 2.3.0 : Fri Oct 11 2024 - 18:36:52 CEST