[wiki] [sites] [dwm] resurrected 'multimon' patches || Gary B. Genett

From: <git_AT_suckless.org>
Date: Sun, 19 Feb 2023 23:42:30 +0100

commit 5ebab75ee8b71cd381f56af30e87c7eca85f9a02
Author: Gary B. Genett <me_AT_garybgenett.net>
Date: Sun Feb 19 14:36:50 2023 -0800

    [dwm] resurrected 'multimon' patches

diff --git a/dwm.suckless.org/patches/historical/multimon/index.md b/dwm.suckless.org/patches/historical/multimon/index.md
deleted file mode 100644
index 6c5dd22c..00000000
--- a/dwm.suckless.org/patches/historical/multimon/index.md
+++ /dev/null
_AT_@ -1,73 +0,0 @@
-multimon
-========
-
-Description
------------
-These patches provide enhancements for working in a multi-monitor environment.
-
-monitor marker:
-
- * Adds a small token to the bar that displays the dwm monitor number.
- * The token has a mouse binding, just like the rest of the bar objects.
-
-unified view:
-
- * Provides two wrapper functions that work across all monitors simultaneously.
- * Can change/toggle the view for all monitors, creating a unified workspace.
-
-reset view:
-
- * Function and settings for a "default view", for checking on primary tasks
- which may have been shuffled out of view doing more focused work.
- * Per-monitor default settings for nmaster and tags.
-
-status all:
-
- * Show/update the status on all bars.
- * Based on
- [statusbar on all monitors](//dwm.suckless.org/patches/statusallmons), but
- uses a configurable boolean.
-
-Each can be applied independently, if desired, except for "reset view" which
-references "ClkMonNum" from "unified view" in "config.def.h". Simply remove the
-reference to get it to apply and compile.
-
-Example configuration settings with comments are included in "config.def.h"
-within each patch.
-
-The default settings and behavior of dwm are not modified by these patches.
-They provide enhancements and new options only, so there should be minimal
-conflict with other dwm patches.
-
-Usage
------
-Each patch can be applied using "patch -p1" or "git am":
-
- cd dwm; patch -p1 < multimon-1-added-monitor-marker-to-bar.diff
-
-**or**
-
- cd dwm; git pull; git am multimon-1-added-monitor-marker-to-bar.diff
-
-There are default settings and bindings in "config.def.h" which you will likely
-want to customize.
-
-Download
---------
-Each of the patches was created by "format-patch" based on commit
-cdec9782a1789bd5c3a84772fd59abb9da288597.
-
-* [multimon-1-added-monitor-marker-to-bar.diff](multimon-1-added-monitor-marker-to-bar.diff) (6228b)
-* [multimon-2-added-n-view-wrappers-for-unified-multi-monitor.diff](multimon-2-added-n-view-wrappers-for-unified-multi-monitor.diff) (6558b)
-* [multimon-3-added-reset\_view-function.diff](multimon-3-added-reset_view-function.diff) (6816b)
-* [multimon-4-added-statusall-toggle-replacing-need-for-patch.diff](multimon-4-added-statusall-toggle-replacing-need-for-patch.diff) (6165b)
-
-The patches are intended to be applied in order, one after the other, but can
-also be used independently.
-
-Author
-------
-* Gary B. Genett - [me_AT_garybgenett.net](mailto:me_AT_garybgenett.net)
-
-Original Submission:
-[//lists.suckless.org/dev/1403/20488.html](//lists.suckless.org/dev/1403/20488.html)
diff --git a/dwm.suckless.org/patches/historical/multimon/multimon-1-added-monitor-marker-to-bar.diff b/dwm.suckless.org/patches/multimon/dwm-multimon-1-monitor_marker-6.1.patch
similarity index 100%
rename from dwm.suckless.org/patches/historical/multimon/multimon-1-added-monitor-marker-to-bar.diff
rename to dwm.suckless.org/patches/multimon/dwm-multimon-1-monitor_marker-6.1.patch
diff --git a/dwm.suckless.org/patches/multimon/dwm-multimon-1-monitor_marker-6.4.patch b/dwm.suckless.org/patches/multimon/dwm-multimon-1-monitor_marker-6.4.patch
new file mode 100644
index 00000000..e72417de
--- /dev/null
+++ b/dwm.suckless.org/patches/multimon/dwm-multimon-1-monitor_marker-6.4.patch
_AT_@ -0,0 +1,196 @@
+From c13f9b5a379422525ec7f714d83a1cbb0e3251c2 Mon Sep 17 00:00:00 2001
+From: "Gary B. Genett" <me_AT_garybgenett.net>
+Date: Sun, 19 Feb 2023 08:56:42 -0800
+Subject: added monitor marker to bar
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------2.37.4"
+
+This is a multi-part message in MIME format.
+--------------2.37.4
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+---
+ config.def.h | 2 ++
+ dwm.c | 12 +++++++++++-
+ 2 files changed, 13 insertions(+), 1 deletion(-)
+
+
+--------------2.37.4
+Content-Type: text/x-patch; name="0001-added-monitor-marker-to-bar.patch"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: attachment; filename="0001-added-monitor-marker-to-bar.patch"
+
+diff --git a/config.def.h b/config.def.h
+index 9efa7744b39c8b0ff0cf09a504a2539910c2881c..9d549ce8628e1a7769ee2a3d5c0a4c6d56ce6931 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -96,20 +96,22 @@ static const Key keys[] = {
+ TAGKEYS( XK_9, 8)
+ { MODKEY|ShiftMask, XK_q, quit, {0} },
+ };
+
+ /* button definitions */
+ /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
+ static const Button buttons[] = {
+ /* click event mask button function argument */
+ { ClkLtSymbol, 0, Button1, setlayout, {0} },
+ { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
++ { ClkMonNum, 0, Button1, focusmon, {.i = +1} },
++ { ClkMonNum, 0, Button3, focusmon, {.i = -1} },
+ { ClkWinTitle, 0, Button2, zoom, {0} },
+ { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
+ { ClkClientWin, MODKEY, Button1, movemouse, {0} },
+ { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
+ { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
+ { ClkTagBar, 0, Button1, view, {0} },
+ { ClkTagBar, 0, Button3, toggleview, {0} },
+ { ClkTagBar, MODKEY, Button1, tag, {0} },
+ { ClkTagBar, MODKEY, Button3, toggletag, {0} },
+ };
+diff --git a/dwm.c b/dwm.c
+index c2bd8710544eb4b4e7eaa4a1307e1f1dfd8d16ba..bc5160a7d46ab07da82f0595abb7700debb2b891 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -57,21 +57,21 @@
+ #define TAGMASK ((1 << LENGTH(tags)) - 1)
+ #define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
+
+ /* enums */
+ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
+ enum { SchemeNorm, SchemeSel }; /* color schemes */
+ enum { NetSupported, NetWMName, NetWMState, NetWMCheck,
+ NetWMFullscreen, NetActiveWindow, NetWMWindowType,
+ NetWMWindowTypeDialog, NetClientList, NetLast }; /* EWMH atoms */
+ enum { WMProtocols, WMDelete, WMState, WMTakeFocus, WMLast }; /* default atoms */
+-enum { ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle,
++enum { ClkTagBar, ClkLtSymbol, ClkMonNum, ClkStatusText, ClkWinTitle,
+ ClkClientWin, ClkRootWin, ClkLast }; /* clicks */
+
+ typedef union {
+ int i;
+ unsigned int ui;
+ float f;
+ const void *v;
+ } Arg;
+
+ typedef struct {
+_AT_@ -106,20 +106,21 @@ typedef struct {
+ const Arg arg;
+ } Key;
+
+ typedef struct {
+ const char *symbol;
+ void (*arrange)(Monitor *);
+ } Layout;
+
+ struct Monitor {
+ char ltsymbol[16];
++ char monmark[16];
+ float mfact;
+ int nmaster;
+ int num;
+ int by; /* bar geometry */
+ int mx, my, mw, mh; /* screen size */
+ int wx, wy, ww, wh; /* window area */
+ unsigned int seltags;
+ unsigned int sellt;
+ unsigned int tagset[2];
+ int showbar;
+_AT_@ -434,20 +435,22 @@ buttonpress(XEvent *e)
+ if (ev->window == selmon->barwin) {
+ i = x = 0;
+ do
+ x += TEXTW(tags[i]);
+ while (ev->x >= x && ++i < LENGTH(tags));
+ if (i < LENGTH(tags)) {
+ click = ClkTagBar;
+ arg.ui = 1 << i;
+ } else if (ev->x < x + TEXTW(selmon->ltsymbol))
+ click = ClkLtSymbol;
++ else if (ev->x < x + TEXTW(selmon->ltsymbol) + TEXTW(selmon->monmark))
++ click = ClkMonNum;
+ else if (ev->x > selmon->ww - (int)TEXTW(stext))
+ click = ClkStatusText;
+ else
+ click = ClkWinTitle;
+ } else if ((c = wintoclient(ev->window))) {
+ focus(c);
+ restack(selmon);
+ XAllowEvents(dpy, ReplayPointer, CurrentTime);
+ click = ClkClientWin;
+ }
+_AT_@ -637,20 +640,22 @@ createmon(void)
+
+ m = ecalloc(1, sizeof(Monitor));
+ m->tagset[0] = m->tagset[1] = 1;
+ m->mfact = mfact;
+ m->nmaster = nmaster;
+ m->showbar = showbar;
+ m->topbar = topbar;
+ m->lt[0] = &layouts[0];
+ m->lt[1] = &layouts[1 % LENGTH(layouts)];
+ strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
++ /* this is actually set in updategeom, to avoid a race condition */
++// snprintf(m->monmark, sizeof(m->monmark), "(%d)", m->num);
+ return m;
+ }
+
+ void
+ destroynotify(XEvent *e)
+ {
+ Client *c;
+ XDestroyWindowEvent *ev = &e->xdestroywindow;
+
+ if ((c = wintoclient(ev->window)))
+_AT_@ -726,20 +731,23 @@ drawbar(Monitor *m)
+ drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
+ if (occ & 1 << i)
+ drw_rect(drw, x + boxs, boxs, boxw, boxw,
+ m == selmon && selmon->sel && selmon->sel->tags & 1 << i,
+ urg & 1 << i);
+ x += w;
+ }
+ w = TEXTW(m->ltsymbol);
+ drw_setscheme(drw, scheme[SchemeNorm]);
+ x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->ltsymbol, 0);
++ w = TEXTW(m->monmark);
++ drw_setscheme(drw, scheme[SchemeNorm]);
++ x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->monmark, 0);
+
+ if ((w = m->ww - tw - x) > bh) {
+ if (m->sel) {
+ drw_setscheme(drw, scheme[m == selmon ? SchemeSel : SchemeNorm]);
+ drw_text(drw, x, 0, w, bh, lrpad / 2, m->sel->name, 0);
+ if (m->sel->isfloating)
+ drw_rect(drw, x + boxs, boxs, boxw, boxw, m->sel->isfixed, 0);
+ } else {
+ drw_setscheme(drw, scheme[SchemeNorm]);
+ drw_rect(drw, x, 0, w, bh, 1, 1);
+_AT_@ -1886,20 +1894,22 @@ updategeom(void)
+ else
+ mons = createmon();
+ }
+ for (i = 0, m = mons; i < nn && m; m = m->next, i++)
+ if (i >= n
+ || unique[i].x_org != m->mx || unique[i].y_org != m->my
+ || unique[i].width != m->mw || unique[i].height != m->mh)
+ {
+ dirty = 1;
+ m->num = i;
++ /* this is ugly, but it is a race condition otherwise */
++ snprintf(m->monmark, sizeof(m->monmark), "(%d)", m->num);
+ m->mx = m->wx = unique[i].x_org;
+ m->my = m->wy = unique[i].y_org;
+ m->mw = m->ww = unique[i].width;
+ m->mh = m->wh = unique[i].height;
+ updatebarpos(m);
+ }
+ /* removed monitors if n > nn */
+ for (i = nn; i < n; i++) {
+ for (m = mons; m && m->next; m = m->next);
+ while ((c = m->clients)) {
+
+--------------2.37.4--
+
+
diff --git a/dwm.suckless.org/patches/historical/multimon/multimon-2-added-n-view-wrappers-for-unified-multi-monitor.diff b/dwm.suckless.org/patches/multimon/dwm-multimon-2-unified_view-6.1.patch
similarity index 100%
rename from dwm.suckless.org/patches/historical/multimon/multimon-2-added-n-view-wrappers-for-unified-multi-monitor.diff
rename to dwm.suckless.org/patches/multimon/dwm-multimon-2-unified_view-6.1.patch
diff --git a/dwm.suckless.org/patches/multimon/dwm-multimon-2-unified_view-6.4.patch b/dwm.suckless.org/patches/multimon/dwm-multimon-2-unified_view-6.4.patch
new file mode 100644
index 00000000..29e5038f
--- /dev/null
+++ b/dwm.suckless.org/patches/multimon/dwm-multimon-2-unified_view-6.4.patch
_AT_@ -0,0 +1,183 @@
+From 96ebf3ddfad143aec93a7d2aa212389121ccae41 Mon Sep 17 00:00:00 2001
+From: "Gary B. Genett" <me_AT_garybgenett.net>
+Date: Sun, 19 Feb 2023 08:57:30 -0800
+Subject: added n*view wrappers, for unified multi-monitor
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------2.37.4"
+
+This is a multi-part message in MIME format.
+--------------2.37.4
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+---
+ config.def.h | 5 +++++
+ dwm.c | 26 ++++++++++++++++++++++++++
+ 2 files changed, 31 insertions(+)
+
+
+--------------2.37.4
+Content-Type: text/x-patch; name="0002-added-n-view-wrappers-for-unified-multi-monitor.patch"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: attachment; filename="0002-added-n-view-wrappers-for-unified-multi-monitor.patch"
+
+diff --git a/config.def.h b/config.def.h
+index 9d549ce8628e1a7769ee2a3d5c0a4c6d56ce6931..c59d27597a62ddf884baacded2830a318db1b45c 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -38,24 +38,27 @@ static const int resizehints = 1; /* 1 means respect size hints in tiled resi
+ static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
+
+ static const Layout layouts[] = {
+ /* symbol arrange function */
+ { "[]=", tile }, /* first entry is default */
+ { "><>", NULL }, /* no layout function means floating behavior */
+ { "[M]", monocle },
+ };
+
+ /* key definitions */
++#define WINKEY Mod4Mask
+ #define MODKEY Mod1Mask
+ #define TAGKEYS(KEY,TAG) \
+ { MODKEY, KEY, view, {.ui = 1 << TAG} }, \
+ { MODKEY|ControlMask, KEY, toggleview, {.ui = 1 << TAG} }, \
++ { MODKEY|WINKEY, KEY, nview, {.ui = 1 << TAG} }, \
++ { MODKEY|WINKEY|ControlMask, KEY, ntoggleview, {.ui = 1 << TAG} }, \
+ { MODKEY|ShiftMask, KEY, tag, {.ui = 1 << TAG} }, \
+ { MODKEY|ControlMask|ShiftMask, KEY, toggletag, {.ui = 1 << TAG} },
+
+ /* helper for spawning shell commands in the pre dwm-5.0 fashion */
+ #define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } }
+
+ /* commands */
+ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn() */
+ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
+ static const char *termcmd[] = { "st", NULL };
+_AT_@ -105,14 +108,16 @@ static const Button buttons[] = {
+ { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
+ { ClkMonNum, 0, Button1, focusmon, {.i = +1} },
+ { ClkMonNum, 0, Button3, focusmon, {.i = -1} },
+ { ClkWinTitle, 0, Button2, zoom, {0} },
+ { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
+ { ClkClientWin, MODKEY, Button1, movemouse, {0} },
+ { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
+ { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
+ { ClkTagBar, 0, Button1, view, {0} },
+ { ClkTagBar, 0, Button3, toggleview, {0} },
++ { ClkTagBar, MODKEY|WINKEY, Button1, nview, {0} },
++ { ClkTagBar, MODKEY|WINKEY, Button3, ntoggleview, {0} },
+ { ClkTagBar, MODKEY, Button1, tag, {0} },
+ { ClkTagBar, MODKEY, Button3, toggletag, {0} },
+ };
+
+diff --git a/dwm.c b/dwm.c
+index bc5160a7d46ab07da82f0595abb7700debb2b891..2cf8d78c22c64ff26eda6195b6bd503f213a4d5f 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -206,34 +206,36 @@ static void setmfact(const Arg *arg);
+ static void setup(void);
+ static void seturgent(Client *c, int urg);
+ static void showhide(Client *c);
+ static void spawn(const Arg *arg);
+ static void tag(const Arg *arg);
+ static void tagmon(const Arg *arg);
+ static void tile(Monitor *m);
+ static void togglebar(const Arg *arg);
+ static void togglefloating(const Arg *arg);
+ static void toggletag(const Arg *arg);
++static void ntoggleview(const Arg *arg);
+ static void toggleview(const Arg *arg);
+ static void unfocus(Client *c, int setfocus);
+ static void unmanage(Client *c, int destroyed);
+ static void unmapnotify(XEvent *e);
+ static void updatebarpos(Monitor *m);
+ static void updatebars(void);
+ static void updateclientlist(void);
+ static int updategeom(void);
+ static void updatenumlockmask(void);
+ static void updatesizehints(Client *c);
+ static void updatestatus(void);
+ static void updatetitle(Client *c);
+ static void updatewindowtype(Client *c);
+ static void updatewmhints(Client *c);
++static void nview(const Arg *arg);
+ static void view(const Arg *arg);
+ static Client *wintoclient(Window w);
+ static Monitor *wintomon(Window w);
+ static int xerror(Display *dpy, XErrorEvent *ee);
+ static int xerrordummy(Display *dpy, XErrorEvent *ee);
+ static int xerrorstart(Display *dpy, XErrorEvent *ee);
+ static void zoom(const Arg *arg);
+
+ /* variables */
+ static const char broken[] = "broken";
+_AT_@ -1743,20 +1745,32 @@ toggletag(const Arg *arg)
+ if (!selmon->sel)
+ return;
+ newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
+ if (newtags) {
+ selmon->sel->tags = newtags;
+ focus(NULL);
+ arrange(selmon);
+ }
+ }
+
++void
++ntoggleview(const Arg *arg)
++{
++ const Arg n = {.i = +1};
++ const int mon = selmon->num;
++ do {
++ focusmon(&n);
++ toggleview(arg);
++ }
++ while (selmon->num != mon);
++}
++
+ void
+ toggleview(const Arg *arg)
+ {
+ unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
+
+ if (newtagset) {
+ selmon->tagset[selmon->seltags] = newtagset;
+ focus(NULL);
+ arrange(selmon);
+ }
+_AT_@ -2045,20 +2059,32 @@ updatewmhints(Client *c)
+ } else
+ c->isurgent = (wmh->flags & XUrgencyHint) ? 1 : 0;
+ if (wmh->flags & InputHint)
+ c->neverfocus = !wmh->input;
+ else
+ c->neverfocus = 0;
+ XFree(wmh);
+ }
+ }
+
++void
++nview(const Arg *arg)
++{
++ const Arg n = {.i = +1};
++ const int mon = selmon->num;
++ do {
++ focusmon(&n);
++ view(arg);
++ }
++ while (selmon->num != mon);
++}
++
+ void
+ view(const Arg *arg)
+ {
+ if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
+ return;
+ selmon->seltags ^= 1; /* toggle sel tagset */
+ if (arg->ui & TAGMASK)
+ selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
+ focus(NULL);
+ arrange(selmon);
+
+--------------2.37.4--
+
+
diff --git a/dwm.suckless.org/patches/historical/multimon/multimon-3-added-reset_view-function.diff b/dwm.suckless.org/patches/multimon/dwm-multimon-3-reset_view-6.1.patch
similarity index 100%
rename from dwm.suckless.org/patches/historical/multimon/multimon-3-added-reset_view-function.diff
rename to dwm.suckless.org/patches/multimon/dwm-multimon-3-reset_view-6.1.patch
diff --git a/dwm.suckless.org/patches/multimon/dwm-multimon-3-reset_view-6.4.patch b/dwm.suckless.org/patches/multimon/dwm-multimon-3-reset_view-6.4.patch
new file mode 100644
index 00000000..93b7c45e
--- /dev/null
+++ b/dwm.suckless.org/patches/multimon/dwm-multimon-3-reset_view-6.4.patch
_AT_@ -0,0 +1,185 @@
+From a69526cdfa0f3c15ac60e290cbd1282cd02a59c5 Mon Sep 17 00:00:00 2001
+From: "Gary B. Genett" <me_AT_garybgenett.net>
+Date: Sun, 19 Feb 2023 08:58:02 -0800
+Subject: added reset_view function
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------2.37.4"
+
+This is a multi-part message in MIME format.
+--------------2.37.4
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+---
+ config.def.h | 9 +++++++++
+ dwm.c | 30 ++++++++++++++++++++++++++++++
+ 2 files changed, 39 insertions(+)
+
+
+--------------2.37.4
+Content-Type: text/x-patch; name="0003-added-reset_view-function.patch"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: attachment; filename="0003-added-reset_view-function.patch"
+
+diff --git a/config.def.h b/config.def.h
+index c59d27597a62ddf884baacded2830a318db1b45c..a664c793845c4c7c0ebe8ac69c96885c76193819 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -27,23 +27,31 @@ static const Rule rules[] = {
+ * WM_NAME(STRING) = title
+ */
+ /* class instance title tags mask isfloating monitor */
+ { "Gimp", NULL, NULL, 0, 1, -1 },
+ { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
+ };
+
+ /* layout(s) */
+ static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
+ static const int nmaster = 1; /* number of clients in master area */
++static const int nviews = 3; /* mask of tags highlighted by default (tags 1-4) */
+ static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
+ static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
+
++static const float facts[1]; //static const float facts[] = { 0, 0.5 }; // = mfact // 50%
++static const int masters[1]; //static const int masters[] = { 0, -1 }; // = nmaster // vertical stacking (for rotated monitor)
++static const int views[1]; //static const int views[] = { 0, ~0 }; // = nviews // all tags
++/* invert tags after nviews */ /* array dimentions can both be as big as needed */ // final highlighted tags
++static const int toggles[1][1]; //static const int toggles[2][2] = { {0,8}, {~0,~0} }; // 2-4+9 // all (leave as views above)
++static const int toggles[1][1] = {{~0}};
++
+ static const Layout layouts[] = {
+ /* symbol arrange function */
+ { "[]=", tile }, /* first entry is default */
+ { "><>", NULL }, /* no layout function means floating behavior */
+ { "[M]", monocle },
+ };
+
+ /* key definitions */
+ #define WINKEY Mod4Mask
+ #define MODKEY Mod1Mask
+_AT_@ -90,30 +97,32 @@ static const Key keys[] = {
+ { MODKEY|ShiftMask, XK_period, tagmon, {.i = +1 } },
+ TAGKEYS( XK_1, 0)
+ TAGKEYS( XK_2, 1)
+ TAGKEYS( XK_3, 2)
+ TAGKEYS( XK_4, 3)
+ TAGKEYS( XK_5, 4)
+ TAGKEYS( XK_6, 5)
+ TAGKEYS( XK_7, 6)
+ TAGKEYS( XK_8, 7)
+ TAGKEYS( XK_9, 8)
++ { MODKEY, XK_grave, reset_view, {0} },
+ { MODKEY|ShiftMask, XK_q, quit, {0} },
+ };
+
+ /* button definitions */
+ /* click can be ClkTagBar, ClkLtSymbol, ClkStatusText, ClkWinTitle, ClkClientWin, or ClkRootWin */
+ static const Button buttons[] = {
+ /* click event mask button function argument */
+ { ClkLtSymbol, 0, Button1, setlayout, {0} },
+ { ClkLtSymbol, 0, Button3, setlayout, {.v = &layouts[2]} },
+ { ClkMonNum, 0, Button1, focusmon, {.i = +1} },
++ { ClkMonNum, 0, Button2, reset_view, {0} },
+ { ClkMonNum, 0, Button3, focusmon, {.i = -1} },
+ { ClkWinTitle, 0, Button2, zoom, {0} },
+ { ClkStatusText, 0, Button2, spawn, {.v = termcmd } },
+ { ClkClientWin, MODKEY, Button1, movemouse, {0} },
+ { ClkClientWin, MODKEY, Button2, togglefloating, {0} },
+ { ClkClientWin, MODKEY, Button3, resizemouse, {0} },
+ { ClkTagBar, 0, Button1, view, {0} },
+ { ClkTagBar, 0, Button3, toggleview, {0} },
+ { ClkTagBar, MODKEY|WINKEY, Button1, nview, {0} },
+ { ClkTagBar, MODKEY|WINKEY, Button3, ntoggleview, {0} },
+diff --git a/dwm.c b/dwm.c
+index 2cf8d78c22c64ff26eda6195b6bd503f213a4d5f..93da0f4565d7a17ef96a1b167cfcb2c9f0ac6ad3 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -229,20 +229,21 @@ static void updatetitle(Client *c);
+ static void updatewindowtype(Client *c);
+ static void updatewmhints(Client *c);
+ static void nview(const Arg *arg);
+ static void view(const Arg *arg);
+ static Client *wintoclient(Window w);
+ static Monitor *wintomon(Window w);
+ static int xerror(Display *dpy, XErrorEvent *ee);
+ static int xerrordummy(Display *dpy, XErrorEvent *ee);
+ static int xerrorstart(Display *dpy, XErrorEvent *ee);
+ static void zoom(const Arg *arg);
++static void reset_view(const Arg *arg);
+
+ /* variables */
+ static const char broken[] = "broken";
+ static char stext[256];
+ static int screen;
+ static int sw, sh; /* X display screen geometry width, height */
+ static int bh; /* bar height */
+ static int lrpad; /* sum of left and right padding for text */
+ static int (*xerrorxlib)(Display *, XErrorEvent *);
+ static unsigned int numlockmask = 0;
+_AT_@ -2161,33 +2162,62 @@ zoom(const Arg *arg)
+ {
+ Client *c = selmon->sel;
+
+ if (!selmon->lt[selmon->sellt]->arrange || !c || c->isfloating)
+ return;
+ if (c == nexttiled(selmon->clients) && !(c = nexttiled(c->next)))
+ return;
+ pop(c);
+ }
+
++void
++reset_view(const Arg *arg) {
++ const int mon = selmon->num;
++ Arg n = {.i = +1}; // focusmon(next monitor)
++ Arg m = {.f = 0}; // mfact -> facts[]
++ Arg i = {.i = 0}; // nmaster -> masters[]
++ Arg v = {.ui = 0}; // nviews -> views[]
++ Arg t = {.ui = 0}; // toggles[] -> toggleview()
++ unsigned int x;
++ do {
++ focusmon(&n);
++ m.f = (facts[selmon->num] ? facts[selmon->num] : mfact) +1;
++ i.i = (masters[selmon->num] ? masters[selmon->num] : nmaster) - selmon->nmaster;
++ v.ui = (views[selmon->num] == ~0 ? ~0 : ((1 << (views[selmon->num] ? (views[selmon->num] +1) : (nviews +1))) -1));
++ setmfact(&m);
++ incnmaster(&i);
++ view(&v);
++ for (x = 0; x < LENGTH(toggles[selmon->num]); x++) {
++ if ((toggles[selmon->num][x] || toggles[selmon->num][x] == 0) && toggles[selmon->num][x] != ~0) {
++ t.ui = (1 << toggles[selmon->num][x]);
++ toggleview(&t);
++ };
++ }
++ }
++ while (selmon->num != mon);
++}
++
+ int
+ main(int argc, char *argv[])
+ {
+ if (argc == 2 && !strcmp("-v", argv[1]))
+ die("dwm-"VERSION);
+ else if (argc != 1)
+ die("usage: dwm [-v]");
+ if (!setlocale(LC_CTYPE, "") || !XSupportsLocale())
+ fputs("warning: no locale support
", stderr);
+ if (!(dpy = XOpenDisplay(NULL)))
+ die("dwm: cannot open display");
+ checkotherwm();
+ setup();
+ #ifdef __OpenBSD__
+ if (pledge("stdio rpath proc exec", NULL) == -1)
+ die("pledge");
+ #endif /* __OpenBSD__ */
+ scan();
++ const Arg r = {0};
++ reset_view(&r);
+ run();
+ cleanup();
+ XCloseDisplay(dpy);
+ return EXIT_SUCCESS;
+ }
+
+--------------2.37.4--
+
+
diff --git a/dwm.suckless.org/patches/historical/multimon/multimon-4-added-statusall-toggle-replacing-need-for-patch.diff b/dwm.suckless.org/patches/multimon/dwm-multimon-4-status_all-6.1.patch
similarity index 100%
rename from dwm.suckless.org/patches/historical/multimon/multimon-4-added-statusall-toggle-replacing-need-for-patch.diff
rename to dwm.suckless.org/patches/multimon/dwm-multimon-4-status_all-6.1.patch
diff --git a/dwm.suckless.org/patches/multimon/dwm-multimon-4-status_all-6.4.patch b/dwm.suckless.org/patches/multimon/dwm-multimon-4-status_all-6.4.patch
new file mode 100644
index 00000000..34643734
--- /dev/null
+++ b/dwm.suckless.org/patches/multimon/dwm-multimon-4-status_all-6.4.patch
_AT_@ -0,0 +1,104 @@
+From 34d7ca93ff7fff443f9cf0ce6ba6da6acbcfe06c Mon Sep 17 00:00:00 2001
+From: "Gary B. Genett" <me_AT_garybgenett.net>
+Date: Sun, 19 Feb 2023 08:59:36 -0800
+Subject: added statusall toggle
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------2.37.4"
+
+This is a multi-part message in MIME format.
+--------------2.37.4
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+---
+ config.def.h | 1 +
+ dwm.c | 4 ++--
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+
+--------------2.37.4
+Content-Type: text/x-patch; name="0004-added-statusall-toggle.patch"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: attachment; filename="0004-added-statusall-toggle.patch"
+
+diff --git a/config.def.h b/config.def.h
+index a664c793845c4c7c0ebe8ac69c96885c76193819..fcfe8245a438686f276ffc9a4df17695382ed58b 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -29,20 +29,21 @@ static const Rule rules[] = {
+ /* class instance title tags mask isfloating monitor */
+ { "Gimp", NULL, NULL, 0, 1, -1 },
+ { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
+ };
+
+ /* layout(s) */
+ static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
+ static const int nmaster = 1; /* number of clients in master area */
+ static const int nviews = 3; /* mask of tags highlighted by default (tags 1-4) */
+ static const int resizehints = 1; /* 1 means respect size hints in tiled resizals */
++static const int statusall = 1; /* 1 means status is shown in all bars, not just active monitor */
+ static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
+
+ static const float facts[1]; //static const float facts[] = { 0, 0.5 }; // = mfact // 50%
+ static const int masters[1]; //static const int masters[] = { 0, -1 }; // = nmaster // vertical stacking (for rotated monitor)
+ static const int views[1]; //static const int views[] = { 0, ~0 }; // = nviews // all tags
+ /* invert tags after nviews */ /* array dimentions can both be as big as needed */ // final highlighted tags
+ static const int toggles[1][1]; //static const int toggles[2][2] = { {0,8}, {~0,~0} }; // 2-4+9 // all (leave as views above)
+ static const int toggles[1][1] = {{~0}};
+
+ static const Layout layouts[] = {
+ /* symbol arrange function */
+diff --git a/dwm.c b/dwm.c
+index 93da0f4565d7a17ef96a1b167cfcb2c9f0ac6ad3..77ff310e03edbf42ac2dd55471962ce259b63071 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -709,21 +709,21 @@ drawbar(Monitor *m)
+ int x, w, tw = 0;
+ int boxs = drw->fonts->h / 9;
+ int boxw = drw->fonts->h / 6 + 2;
+ unsigned int i, occ = 0, urg = 0;
+ Client *c;
+
+ if (!m->showbar)
+ return;
+
+ /* draw status first so it can be overdrawn by tags later */
+- if (m == selmon) { /* status is only drawn on selected monitor */
++ if (m == selmon || statusall) { /* status is only drawn on selected monitor */
+ drw_setscheme(drw, scheme[SchemeNorm]);
+ tw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
+ drw_text(drw, m->ww - tw, 0, tw, bh, 0, stext, 0);
+ }
+
+ for (c = m->clients; c; c = c->next) {
+ occ |= c->tags;
+ if (c->isurgent)
+ urg |= c->tags;
+ }
+_AT_@ -2017,21 +2017,21 @@ updatesizehints(Client *c)
+ c->maxa = c->mina = 0.0;
+ c->isfixed = (c->maxw && c->maxh && c->maxw == c->minw && c->maxh == c->minh);
+ c->hintsvalid = 1;
+ }
+
+ void
+ updatestatus(void)
+ {
+ if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
+ strcpy(stext, "dwm-"VERSION);
+- drawbar(selmon);
++ statusall ? drawbars() : drawbar(selmon);
+ }
+
+ void
+ updatetitle(Client *c)
+ {
+ if (!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name))
+ gettextprop(c->win, XA_WM_NAME, c->name, sizeof c->name);
+ if (c->name[0] == '+ strcpy(c->name, broken);
+ }
+
+--------------2.37.4--
+
+
diff --git a/dwm.suckless.org/patches/multimon/dwm-multimon-5-push_up_down-6.4.patch b/dwm.suckless.org/patches/multimon/dwm-multimon-5-push_up_down-6.4.patch
new file mode 100644
index 00000000..ec2bb492
--- /dev/null
+++ b/dwm.suckless.org/patches/multimon/dwm-multimon-5-push_up_down-6.4.patch
_AT_@ -0,0 +1,187 @@
+From 9a762d6e157bb057c7296f94579ab9632882d60f Mon Sep 17 00:00:00 2001
+From: "Gary B. Genett" <me_AT_garybgenett.net>
+Date: Sun, 19 Feb 2023 09:37:49 -0800
+Subject: patches/push: dwm-push-20201112-61bb8b2.diff
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------2.37.4"
+
+This is a multi-part message in MIME format.
+--------------2.37.4
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+
+ modified from sites: 38b351cf3689ff3fa4845d35ce9894fd9253dbb8
+---
+ config.def.h | 2 ++
+ dwm.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 61 insertions(+)
+
+
+--------------2.37.4
+Content-Type: text/x-patch; name="0005-patches-push-dwm-push-20201112-61bb8b2.diff.patch"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: attachment; filename="0005-patches-push-dwm-push-20201112-61bb8b2.diff.patch"
+
+diff --git a/config.def.h b/config.def.h
+index fcfe8245a438686f276ffc9a4df17695382ed58b..fd00f7080db9271912d0e4352434739d3c08e1b3 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -71,20 +71,22 @@ static char dmenumon[2] = "0"; /* component of dmenucmd, manipulated in spawn()
+ static const char *dmenucmd[] = { "dmenu_run", "-m", dmenumon, "-fn", dmenufont, "-nb", col_gray1, "-nf", col_gray3, "-sb", col_cyan, "-sf", col_gray4, NULL };
+ static const char *termcmd[] = { "st", NULL };
+
+ static const Key keys[] = {
+ /* modifier key function argument */
+ { 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_k, focusstack, {.i = -1 } },
++ { MODKEY|ShiftMask, XK_j, pushdown, {0} },
++ { MODKEY|ShiftMask, XK_k, pushup, {0} },
+ { MODKEY, XK_i, incnmaster, {.i = +1 } },
+ { MODKEY, XK_d, incnmaster, {.i = -1 } },
+ { MODKEY, XK_h, setmfact, {.f = -0.05} },
+ { MODKEY, XK_l, setmfact, {.f = +0.05} },
+ { MODKEY, XK_Return, zoom, {0} },
+ { MODKEY, XK_Tab, view, {0} },
+ { MODKEY|ShiftMask, XK_c, killclient, {0} },
+ { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
+ { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
+ { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
+diff --git a/dwm.c b/dwm.c
+index 77ff310e03edbf42ac2dd55471962ce259b63071..5aa229611a27b8aa943308314b494c10e2364137 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -178,25 +178,28 @@ static void grabbuttons(Client *c, int focused);
+ static void grabkeys(void);
+ static void incnmaster(const Arg *arg);
+ static void keypress(XEvent *e);
+ static void killclient(const Arg *arg);
+ static void manage(Window w, XWindowAttributes *wa);
+ static void mappingnotify(XEvent *e);
+ static void maprequest(XEvent *e);
+ static void monocle(Monitor *m);
+ static void motionnotify(XEvent *e);
+ static void movemouse(const Arg *arg);
++static Client *prevtiled(Client *c);
+ static Client *nexttiled(Client *c);
+ static void pop(Client *c);
+ static void propertynotify(XEvent *e);
+ static void quit(const Arg *arg);
+ static Monitor *recttomon(int x, int y, int w, int h);
++static void pushdown(const Arg *arg);
++static void pushup(const Arg *arg);
+ static void resize(Client *c, int x, int y, int w, int h, int interact);
+ static void resizeclient(Client *c, int x, int y, int w, int h);
+ static void resizemouse(const Arg *arg);
+ static void restack(Monitor *m);
+ static void run(void);
+ static void scan(void);
+ static int sendevent(Client *c, Atom proto);
+ static void sendmon(Client *c, Monitor *m);
+ static void setclientstate(Client *c, long state);
+ static void setfocus(Client *c);
+_AT_@ -1206,20 +1209,31 @@ movemouse(const Arg *arg)
+ }
+ } while (ev.type != ButtonRelease);
+ XUngrabPointer(dpy, CurrentTime);
+ if ((m = recttomon(c->x, c->y, c->w, c->h)) != selmon) {
+ sendmon(c, m);
+ selmon = m;
+ focus(NULL);
+ }
+ }
+
++Client *
++prevtiled(Client *c)
++{
++ Client *p, *r;
++
++ for(p = selmon->clients, r = NULL; p && p != c; p = p->next)
++ if(!p->isfloating && ISVISIBLE(p))
++ r = p;
++ return r;
++}
++
+ Client *
+ nexttiled(Client *c)
+ {
+ for (; c && (c->isfloating || !ISVISIBLE(c)); c = c->next);
+ return c;
+ }
+
+ void
+ pop(Client *c)
+ {
+_AT_@ -1279,20 +1293,65 @@ recttomon(int x, int y, int w, int h)
+ int a, area = 0;
+
+ for (m = mons; m; m = m->next)
+ if ((a = INTERSECT(x, y, w, h, m)) > area) {
+ area = a;
+ r = m;
+ }
+ return r;
+ }
+
++void
++pushdown(const Arg *arg)
++{
++ Client *sel = selmon->sel, *c;
++
++ if(!sel || sel->isfloating)
++ return;
++ if((c = nexttiled(sel->next))) {
++ detach(sel);
++ sel->next = c->next;
++ c->next = sel;
++ } else {
++ detach(sel);
++ attach(sel);
++ }
++ focus(sel);
++ arrange(selmon);
++}
++
++void
++pushup(const Arg *arg)
++{
++ Client *sel = selmon->sel, *c;
++
++ if(!sel || sel->isfloating)
++ return;
++ if((c = prevtiled(sel))) {
++ detach(sel);
++ sel->next = c;
++ if(selmon->clients == c)
++ selmon->clients = sel;
++ else {
++ for(c = selmon->clients; c->next != sel->next; c = c->next);
++ c->next = sel;
++ }
++ } else {
++ for(c = sel; c->next; c = c->next);
++ detach(sel);
++ sel->next = NULL;
++ c->next = sel;
++ }
++ focus(sel);
++ arrange(selmon);
++}
++
+ void
+ resize(Client *c, int x, int y, int w, int h, int interact)
+ {
+ if (applysizehints(c, &x, &y, &w, &h, interact))
+ resizeclient(c, x, y, w, h);
+ }
+
+ void
+ resizeclient(Client *c, int x, int y, int w, int h)
+ {
+
+--------------2.37.4--
+
+
diff --git a/dwm.suckless.org/patches/multimon/dwm-multimon-6-swap_focus-6.4.patch b/dwm.suckless.org/patches/multimon/dwm-multimon-6-swap_focus-6.4.patch
new file mode 100644
index 00000000..c98ea6e7
--- /dev/null
+++ b/dwm.suckless.org/patches/multimon/dwm-multimon-6-swap_focus-6.4.patch
_AT_@ -0,0 +1,187 @@
+From de73c72af0250f56f9ac30a5c3f4520da250282a Mon Sep 17 00:00:00 2001
+From: "Gary B. Genett" <me_AT_garybgenett.net>
+Date: Sun, 19 Feb 2023 09:40:00 -0800
+Subject: patches/swapfocus: dwm-swapfocus-20160731-56a31dc.diff
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------2.37.4"
+
+This is a multi-part message in MIME format.
+--------------2.37.4
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+
+ modified from sites: 38b351cf3689ff3fa4845d35ce9894fd9253dbb8
+---
+ config.def.h | 1 +
+ dwm.c | 19 ++++++++++++++++++-
+ 2 files changed, 19 insertions(+), 1 deletion(-)
+
+
+--------------2.37.4
+Content-Type: text/x-patch; name="0006-patches-swapfocus-dwm-swapfocus-20160731-56a31dc.dif.patch"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: attachment; filename="0006-patches-swapfocus-dwm-swapfocus-20160731-56a31dc.dif.patch"
+
+diff --git a/config.def.h b/config.def.h
+index fd00f7080db9271912d0e4352434739d3c08e1b3..9a1118791c3a2f875b58bf3979db5074416b8634 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -79,20 +79,21 @@ static const Key keys[] = {
+ { MODKEY, XK_j, focusstack, {.i = +1 } },
+ { MODKEY, XK_k, focusstack, {.i = -1 } },
+ { MODKEY|ShiftMask, XK_j, pushdown, {0} },
+ { MODKEY|ShiftMask, XK_k, pushup, {0} },
+ { MODKEY, XK_i, incnmaster, {.i = +1 } },
+ { MODKEY, XK_d, incnmaster, {.i = -1 } },
+ { MODKEY, XK_h, setmfact, {.f = -0.05} },
+ { MODKEY, XK_l, setmfact, {.f = +0.05} },
+ { MODKEY, XK_Return, zoom, {0} },
+ { MODKEY, XK_Tab, view, {0} },
++ { MODKEY|ShiftMask, XK_Tab, swapfocus, {0} },
+ { MODKEY|ShiftMask, XK_c, killclient, {0} },
+ { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
+ { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
+ { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
+ { MODKEY, XK_space, setlayout, {0} },
+ { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
+ { MODKEY, XK_0, view, {.ui = ~0 } },
+ { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
+ { MODKEY, XK_comma, focusmon, {.i = -1 } },
+ { MODKEY, XK_period, focusmon, {.i = +1 } },
+diff --git a/dwm.c b/dwm.c
+index 5aa229611a27b8aa943308314b494c10e2364137..ac52b8c25991a073db15b55fae774e9c47a05708 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -203,20 +203,21 @@ static int sendevent(Client *c, Atom proto);
+ static void sendmon(Client *c, Monitor *m);
+ static void setclientstate(Client *c, long state);
+ static void setfocus(Client *c);
+ static void setfullscreen(Client *c, int fullscreen);
+ static void setlayout(const Arg *arg);
+ static void setmfact(const Arg *arg);
+ static void setup(void);
+ static void seturgent(Client *c, int urg);
+ static void showhide(Client *c);
+ static void spawn(const Arg *arg);
++static void swapfocus(const Arg *arg);
+ static void tag(const Arg *arg);
+ static void tagmon(const Arg *arg);
+ static void tile(Monitor *m);
+ static void togglebar(const Arg *arg);
+ static void togglefloating(const Arg *arg);
+ static void toggletag(const Arg *arg);
+ static void ntoggleview(const Arg *arg);
+ static void toggleview(const Arg *arg);
+ static void unfocus(Client *c, int setfocus);
+ static void unmanage(Client *c, int destroyed);
+_AT_@ -235,20 +236,21 @@ static void nview(const Arg *arg);
+ static void view(const Arg *arg);
+ static Client *wintoclient(Window w);
+ static Monitor *wintomon(Window w);
+ static int xerror(Display *dpy, XErrorEvent *ee);
+ static int xerrordummy(Display *dpy, XErrorEvent *ee);
+ static int xerrorstart(Display *dpy, XErrorEvent *ee);
+ static void zoom(const Arg *arg);
+ static void reset_view(const Arg *arg);
+
+ /* variables */
++static Client *prevclient = NULL;
+ static const char broken[] = "broken";
+ static char stext[256];
+ static int screen;
+ static int sw, sh; /* X display screen geometry width, height */
+ static int bh; /* bar height */
+ static int lrpad; /* sum of left and right padding for text */
+ static int (*xerrorxlib)(Display *, XErrorEvent *);
+ static unsigned int numlockmask = 0;
+ static void (*handler[LASTEvent]) (XEvent *) = {
+ [ButtonPress] = buttonpress,
+_AT_@ -1721,20 +1723,32 @@ spawn(const Arg *arg)
+ dmenumon[0] = '0' + selmon->num;
+ if (fork() == 0) {
+ if (dpy)
+ close(ConnectionNumber(dpy));
+ setsid();
+ execvp(((char **)arg->v)[0], (char **)arg->v);
+ die("dwm: execvp '%s' failed:", ((char **)arg->v)[0]);
+ }
+ }
+
++void
++swapfocus(const Arg *arg)
++{
++ Client *c;
++
++ for(c = selmon->clients; c && c != prevclient; c = c->next) ;
++ if(c == prevclient) {
++ focus(prevclient);
++ restack(prevclient->mon);
++ }
++}
++
+ void
+ tag(const Arg *arg)
+ {
+ if (selmon->sel && arg->ui & TAGMASK) {
+ selmon->sel->tags = arg->ui & TAGMASK;
+ focus(NULL);
+ arrange(selmon);
+ }
+ }
+
+_AT_@ -1834,20 +1848,21 @@ toggleview(const Arg *arg)
+ focus(NULL);
+ arrange(selmon);
+ }
+ }
+
+ void
+ unfocus(Client *c, int setfocus)
+ {
+ if (!c)
+ return;
++ prevclient = c;
+ grabbuttons(c, 0);
+ XSetWindowBorder(dpy, c->win, scheme[SchemeNorm][ColBorder].pixel);
+ if (setfocus) {
+ XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
+ XDeleteProperty(dpy, root, netatom[NetActiveWindow]);
+ }
+ }
+
+ void
+ unmanage(Client *c, int destroyed)
+_AT_@ -2213,25 +2228,27 @@ int
+ xerrorstart(Display *dpy, XErrorEvent *ee)
+ {
+ die("dwm: another window manager is already running");
+ return -1;
+ }
+
+ void
+ zoom(const Arg *arg)
+ {
+ Client *c = selmon->sel;
++ prevclient = nexttiled(selmon->clients);
+
+ if (!selmon->lt[selmon->sellt]->arrange || !c || c->isfloating)
+ return;
+ if (c == nexttiled(selmon->clients) && !(c = nexttiled(c->next)))
+- return;
++ if (!c || !(c = prevclient = nexttiled(c->next)))
++ return;
+ pop(c);
+ }
+
+ void
+ reset_view(const Arg *arg) {
+ const int mon = selmon->num;
+ Arg n = {.i = +1}; // focusmon(next monitor)
+ Arg m = {.f = 0}; // mfact -> facts[]
+ Arg i = {.i = 0}; // nmaster -> masters[]
+ Arg v = {.ui = 0}; // nviews -> views[]
+
+--------------2.37.4--
+
+
diff --git a/dwm.suckless.org/patches/multimon/dwm-multimon-7-focus_on_active-6.4.patch b/dwm.suckless.org/patches/multimon/dwm-multimon-7-focus_on_active-6.4.patch
new file mode 100644
index 00000000..3b5bb502
--- /dev/null
+++ b/dwm.suckless.org/patches/multimon/dwm-multimon-7-focus_on_active-6.4.patch
_AT_@ -0,0 +1,61 @@
+From ef123521987ec72df95a05542f6558999b673863 Mon Sep 17 00:00:00 2001
+From: "Gary B. Genett" <me_AT_garybgenett.net>
+Date: Sun, 19 Feb 2023 09:09:23 -0800
+Subject: patches/focusonnetactive: dwm-focusonnetactive-6.2.diff
+MIME-Version: 1.0
+Content-Type: multipart/mixed; boundary="------------2.37.4"
+
+This is a multi-part message in MIME format.
+--------------2.37.4
+Content-Type: text/plain; charset=UTF-8; format=fixed
+Content-Transfer-Encoding: 8bit
+
+
+ modified from sites: 38b351cf3689ff3fa4845d35ce9894fd9253dbb8
+ used old dwm code instead: bb3bd6fec37174e8d4bb9457ca815c00609e5157
+---
+ dwm.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+
+--------------2.37.4
+Content-Type: text/x-patch; name="0007-patches-focusonnetactive-dwm-focusonnetactive-6.2.di.patch"
+Content-Transfer-Encoding: 8bit
+Content-Disposition: attachment; filename="0007-patches-focusonnetactive-dwm-focusonnetactive-6.2.di.patch"
+
+diff --git a/dwm.c b/dwm.c
+index ac52b8c25991a073db15b55fae774e9c47a05708..3294c2fe53785473397b6e978c79a704cb7e8f25 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -530,22 +530,25 @@ clientmessage(XEvent *e)
+ Client *c = wintoclient(cme->window);
+
+ if (!c)
+ return;
+ if (cme->message_type == netatom[NetWMState]) {
+ if (cme->data.l[1] == netatom[NetWMFullscreen]
+ || cme->data.l[2] == netatom[NetWMFullscreen])
+ setfullscreen(c, (cme->data.l[0] == 1 /* _NET_WM_STATE_ADD */
+ || (cme->data.l[0] == 2 /* _NET_WM_STATE_TOGGLE */ && !c->isfullscreen)));
+ } else if (cme->message_type == netatom[NetActiveWindow]) {
+- if (c != selmon->sel && !c->isurgent)
+- seturgent(c, 1);
++ if (!ISVISIBLE(c)) {
++ c->mon->seltags ^= 1;
++ c->mon->tagset[c->mon->seltags] = c->tags;
++ }
++ pop(c);
+ }
+ }
+
+ void
+ configure(Client *c)
+ {
+ XConfigureEvent ce;
+
+ ce.type = ConfigureNotify;
+ ce.display = dpy;
+
+--------------2.37.4--
+
+
diff --git a/dwm.suckless.org/patches/multimon/index.md b/dwm.suckless.org/patches/multimon/index.md
new file mode 100644
index 00000000..19b71920
--- /dev/null
+++ b/dwm.suckless.org/patches/multimon/index.md
_AT_@ -0,0 +1,96 @@
+multimon
+========
+
+Description
+-----------
+These patches provide a number of enhancements for working in a multi-monitor
+environment.
+
+monitor marker:
+* Adds a small token to the bar that displays the `dwm` monitor number
+
+unified view:
+* Provides two wrapper functions that work across all monitors simultaneously
+* Can change/toggle the view for all monitors with a single click/key, creating
+ a unified workspace
+
+reset view:
+* Function and settings for a "default view"
+* Supports workflows with a number of always-open core windows, on specific
+ tags, where a single click/key switches to them
+* Enables per-monitor `mfact`, `nmaster` and list of highlighted tags
+* Switches to the configured view on startup
+
+status all:
+* Show/update the status on all bars
+* Based on [statusallmons](http://dwm.suckless.org/patches/statusallmons), but
+ uses a configurable boolean
+
+push up/down:
+* Move windows up and down the clients list
+* Ported version of [push](http://dwm.suckless.org/patches/push), so it applies
+ seamlessly with these patches
+
+swap focus:
+* Switch focus between current/last window with a single shortcut
+* Based on [swapfocus](http://dwm.suckless.org/patches/swapfocus), but updated
+ to work on the newest version
+
+focus on active:
+* Switch focus to activated windows
+* Based on
+ [focusonnetactive](http://dwm.suckless.org/patches/focusonnetactive), but
+ uses the original `dwm` code instead of resetting the highlighted tags.
+
+Usage
+-----
+Other than "focus on active", the default settings and behavior of `dwm` are not
+modified by these patches. The `config.h` configuration needs to be modified
+to take advantage of them.
+
+They are intended to be applied in order, one after the other. They can also
+be used independently, except for "reset view" which depends on "monitor
+marker". Using `patch -F10 -p1` will automatically address any rejects.
+
+Example configuration settings with comments are included in `config.def.h` for
+each patch.
+
+Download
+--------
+Version 6.4 (2023-02-19) --
+*(commit: `2023-02-17 348f6559ab0d4793db196ffa56ba96ab95a594a6`)*
+* [dwm-multimon-1-monitor_marker-6.4.patch](dwm-multimon-1-monitor_marker-6.4.patch)
+ (6902b)
+* [dwm-multimon-2-unified_view-6.4.patch](dwm-multimon-2-unified_view-6.4.patch)
+ (6582b)
+* [dwm-multimon-3-reset_view-6.4.patch](dwm-multimon-3-reset_view-6.4.patch)
+ (7758b)
+* [dwm-multimon-4-status_all-6.4.patch](dwm-multimon-4-status_all-6.4.patch)
+ (3946b)
+* [dwm-multimon-5-push_up_down-6.4.patch](dwm-multimon-5-push_up_down-6.4.patch)
+ (5895b)
+* [dwm-multimon-6-swap_focus-6.4.patch](dwm-multimon-6-swap_focus-6.4.patch)
+ (6495b)
+* [dwm-multimon-7-focus_on_active-6.4.patch](dwm-multimon-7-focus_on_active-6.4.patch)
+ (1851b)
+
+Version 6.1 (2014-03-26) --
+*(commit: `2013-08-27 cdec9782a1789bd5c3a84772fd59abb9da288597`)*
+* [dwm-multimon-1-monitor_marker-6.1.patch](dwm-multimon-1-monitor_marker-6.1.patch)
+ (6228b)
+* [dwm-multimon-2-unified_view-6.1.patch](dwm-multimon-2-unified_view-6.1.patch)
+ (6558b)
+* [dwm-multimon-3-reset_view-6.1.patch](dwm-multimon-3-reset_view-6.1.patch)
+ (6816b)
+* [dwm-multimon-4-status_all-6.1.patch](dwm-multimon-4-status_all-6.1.patch)
+ (6165b)
+
+Forked `dwm` repository is maintained at:
+[github.com/garybgenett/.dwm](http://github.com/garybgenett/.dwm)
+
+Author
+------
+* Gary B. Genett - [me_AT_garybgenett.net](mailto:me_AT_garybgenett.net)
+
+Original Submission:
+[lists.suckless.org/dev/1403/20488.html](http://lists.suckless.org/dev/1403/20488.html)
Received on Sun Feb 19 2023 - 23:42:30 CET

This archive was generated by hypermail 2.3.0 : Sun Feb 19 2023 - 23:48:50 CET