[wiki] [sites] dwm patch to switch selected tag of all monitors || yasumori

From: <git_AT_suckless.org>
Date: Fri, 27 May 2022 08:27:47 +0200

commit 96b24f6371f4c3be4ecd12a63eed3cd4e95edd72
Author: yasumori <ysmr_AT_protonmail.com>
Date: Fri May 27 01:08:22 2022 -0400

    dwm patch to switch selected tag of all monitors
    
    This patch allows the user to switch the selected tag of all monitors.
    For example, if monitor A is currently on tag 1, and monitor B is on tag 2,
    and the user presses MODKEY+SUPERKEY+3, both monitor A and B will switch to
    tag 3 (without changing the currently selected monitor).

diff --git a/dwm.suckless.org/patches/switch_all_monitor_tags/dwm-switchallmonitortags-6.3.diff b/dwm.suckless.org/patches/switch_all_monitor_tags/dwm-switchallmonitortags-6.3.diff
new file mode 100644
index 00000000..84dc79b0
--- /dev/null
+++ b/dwm.suckless.org/patches/switch_all_monitor_tags/dwm-switchallmonitortags-6.3.diff
_AT_@ -0,0 +1,63 @@
+From 31b89fe119b4a0298da98891aa37b134facb6311 Mon Sep 17 00:00:00 2001
+From: yasumori <ysmr_AT_protonmail.com>
+Date: Fri, 27 May 2022 00:21:27 -0400
+Subject: [PATCH] This patch allows the user to switch the selected tag of all
+ monitors.
+
+For example, if monitor A is currently on tag 1, and monitor B is on tag 2,
+and the user presses MODKEY+SUPERKEY+3, both monitor A and B will switch to
+tag 3 (without changing the currently selected monitor).
+---
+ config.def.h | 2 ++
+ dwm.c | 13 +++++++++++++
+ 2 files changed, 15 insertions(+)
+
+diff --git a/config.def.h b/config.def.h
+index a2ac963..3f504ab 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -46,8 +46,10 @@ static const Layout layouts[] = {
+
+ /* key definitions */
+ #define MODKEY Mod1Mask
++#define SUPERKEY Mod4Mask
+ #define TAGKEYS(KEY,TAG) \
+ { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
++ { MODKEY|SUPERKEY, KEY, viewall, {.ui = 1 << TAG} }, \
+ { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
+ { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
+ { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
+diff --git a/dwm.c b/dwm.c
+index 5646a5c..28736ee 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -228,6 +228,7 @@ static void updatetitle(Client *c);
+ static void updatewindowtype(Client *c);
+ static void updatewmhints(Client *c);
+ static void view(const Arg *arg);
++static void viewall(const Arg *arg);
+ static Client *wintoclient(Window w);
+ static Monitor *wintomon(Window w);
+ static int xerror(Display *dpy, XErrorEvent *ee);
+_AT_@ -2054,6 +2055,18 @@ view(const Arg *arg)
+ arrange(selmon);
+ }
+
++void
++viewall(const Arg *arg)
++{
++ Monitor *m;
++
++ for (m = mons; m; m = m->next) {
++ m->tagset[m->seltags] = arg->ui;
++ arrange(m);
++ }
++ focus(NULL);
++}
++
+ Client *
+ wintoclient(Window w)
+ {
+--
+2.36.1
+
diff --git a/dwm.suckless.org/patches/switch_all_monitor_tags/index.md b/dwm.suckless.org/patches/switch_all_monitor_tags/index.md
new file mode 100644
index 00000000..e066543a
--- /dev/null
+++ b/dwm.suckless.org/patches/switch_all_monitor_tags/index.md
_AT_@ -0,0 +1,23 @@
+switch all monitor tags
+=======================
+
+Description
+-----------
+Switches the selected tag of all monitors.
+
+The patch modifies `config.def.h`. Make sure to update `config.h` accordingly,
+if the file exists.
+
+Example Usage
+-------------
+If monitor A is on tag 1, and monitor B is on tag 2, and the
+user inputs `Alt+Super+3`,
+both Monitors will switch to tag 3 (the currently selected monitor will not change).
+
+Download
+--------
+* [dwm-switchallmonitortags-6.3.diff](dwm-switchallmonitortags-6.3.diff)
+
+Author
+------
+* yasumori <ysmr_AT_protonmail.com>
Received on Fri May 27 2022 - 08:27:47 CEST

This archive was generated by hypermail 2.3.0 : Fri May 27 2022 - 08:36:37 CEST