[wiki] [sites] added patch page: defaultmfact || Rumen
commit bb95ccab5e7c4c06335d71fd118f92d3b703b3a9
Author: Rumen <rumenmitov_AT_protonmail.com>
Date: Fri Jan 3 13:01:45 2025 +0100
added patch page: defaultmfact
patch allows for a default mfact value, which setmfact
can be reset back to
diff --git a/dwm.suckless.org/patches/defaultmfact/dwm-defaultmfact-6.5.diff b/dwm.suckless.org/patches/defaultmfact/dwm-defaultmfact-6.5.diff
new file mode 100644
index 00000000..8a4dfe7d
--- /dev/null
+++ b/dwm.suckless.org/patches/defaultmfact/dwm-defaultmfact-6.5.diff
_AT_@ -0,0 +1,56 @@
+From c22678978ff22d2c40c56ffecd7a9306183872f5 Mon Sep 17 00:00:00 2001
+From: Rumen <rumenmitov_AT_protonmail.com>
+Date: Fri, 3 Jan 2025 12:36:19 +0100
+Subject: [PATCH] patch: setting default mfact + example keybind
+
+---
+ config.def.h | 4 +++-
+ dwm.c | 7 +++++++
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/config.def.h b/config.def.h
+index 9efa774..368fc0e 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -32,7 +32,8 @@ static const Rule rules[] = {
+ };
+
+ /* layout(s) */
+-static const float mfact = 0.55; /* factor of master area size [0.05..0.95] */
++#define DEFAULT_MFACT
++static const float mfact = DEFAULT_MFACT; /* factor of master area size [0.05..0.95] */
+ static const int nmaster = 1; /* number of clients in master area */
+ 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 */
+_AT_@ -71,6 +72,7 @@ static const Key keys[] = {
+ { MODKEY, XK_d, incnmaster, {.i = -1 } },
+ { MODKEY, XK_h, setmfact, {.f = -0.05} },
+ { MODKEY, XK_l, setmfact, {.f = +0.05} },
++ { MODKEY, XK_equal, setmfact, {.f = -1.0} },
+ { MODKEY, XK_Return, zoom, {0} },
+ { MODKEY, XK_Tab, view, {0} },
+ { MODKEY|ShiftMask, XK_c, killclient, {0} },
+diff --git a/dwm.c b/dwm.c
+index 1443802..057fde7 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -1521,9 +1521,16 @@ setlayout(const Arg *arg)
+ }
+
+ /* arg > 1.0 will set mfact absolutely */
++/* arg <= -1.0 will set mfact to MASTER_DEFAULT */
+ void
+ setmfact(const Arg *arg)
+ {
++ if (arg->f <= -1.0) {
++ selmon->mfact = MASTER_DEFAULT;
++ arrange(selmon);
++ return;
++ }
++
+ float f;
+
+ if (!arg || !selmon->lt[selmon->sellt]->arrange)
+--
+2.47.1
+
diff --git a/dwm.suckless.org/patches/defaultmfact/index.md b/dwm.suckless.org/patches/defaultmfact/index.md
new file mode 100644
index 00000000..ff5c26e3
--- /dev/null
+++ b/dwm.suckless.org/patches/defaultmfact/index.md
_AT_@ -0,0 +1,17 @@
+defaultmfact
+============
+
+Description
+-----------
+Allows master tile separator to be reset to default value (DEFAULT_MFACT).
+Default keybinding for this behaviour is MODMASK + XK_equal.
+
+Tested only with Tiled layout so far.
+
+Download
+--------
+* [dwm-defaultmfact-6.5.diff](dwm-defaultmfact-6.5.diff), 2025-01-03
+
+Author
+------
+* Rumen Mitov - <rumen.valmitov_AT_gmail.com>
Received on Fri Jan 03 2025 - 13:04:06 CET
This archive was generated by hypermail 2.3.0
: Fri Jan 03 2025 - 13:12:55 CET