From d00a5f3227fe3376cc92824f2bfe8aeebbdaa673 Mon Sep 17 00:00:00 2001 From: Jakub Date: Thu, 23 May 2024 19:38:10 -0400 Subject: [PATCH] also reset nmaster w/ reset layout --- dwm.c | 3 ++ .../behavior/dwm-resetnmaster-pertag-6.3.diff | 36 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 patches/behavior/dwm-resetnmaster-pertag-6.3.diff diff --git a/dwm.c b/dwm.c index 71988c4..89dec12 100644 --- a/dwm.c +++ b/dwm.c @@ -1744,6 +1744,9 @@ resetlayout(const Arg *arg) setlayout(&default_layout); setmfact(&default_mfact); + + selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = nmaster; + arrange(selmon); } void diff --git a/patches/behavior/dwm-resetnmaster-pertag-6.3.diff b/patches/behavior/dwm-resetnmaster-pertag-6.3.diff new file mode 100644 index 0000000..a3d12c0 --- /dev/null +++ b/patches/behavior/dwm-resetnmaster-pertag-6.3.diff @@ -0,0 +1,36 @@ +diff -r -u a/config.def.h b/config.def.h +--- a/config.def.h 2022-01-07 06:42:18.000000000 -0500 ++++ b/config.def.h 2022-01-23 16:03:42.521951418 -0500 +@@ -69,6 +69,7 @@ + { MODKEY, XK_k, focusstack, {.i = -1 } }, + { MODKEY, XK_i, incnmaster, {.i = +1 } }, + { MODKEY, XK_d, incnmaster, {.i = -1 } }, ++ { MODKEY, XK_o, resetnmaster, {0} }, + { MODKEY, XK_h, setmfact, {.f = -0.05} }, + { MODKEY, XK_l, setmfact, {.f = +0.05} }, + { MODKEY, XK_Return, zoom, {0} }, +diff -r -u a/dwm.c b/dwm.c +--- a/dwm.c 2022-01-23 16:06:01.221948285 -0500 ++++ b/dwm.c 2022-01-23 16:05:35.949948855 -0500 +@@ -191,6 +191,7 @@ + static void propertynotify(XEvent *e); + static void quit(const Arg *arg); + static Monitor *recttomon(int x, int y, int w, int h); ++static void resetnmaster(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); +@@ -1296,6 +1297,13 @@ + } + + void ++resetnmaster(const Arg *arg) ++{ ++ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = 1; ++ arrange(selmon); ++} ++ ++void + resize(Client *c, int x, int y, int w, int h, int interact) + { + if (applysizehints(c, &x, &y, &w, &h, interact))