Introduction
Introduction Statistics Contact Development Disclaimer Help
dwm-defaultmfact-6.5.diff - sites - public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log
Files
Refs
---
dwm-defaultmfact-6.5.diff (2016B)
---
1 From 7c770d00c0010e93b37042e9fdff34e3d161ff15 Mon Sep 17 00:00:00 2001
2 From: Rumen <[email protected]>
3 Date: Fri, 3 Jan 2025 17:14:51 +0100
4 Subject: [PATCH] patch: defaultmfact
5
6 patch adds a default value for mfact, which can be used through
7 setmfact
8 ---
9 config.def.h | 4 +++-
10 dwm.c | 7 +++++++
11 2 files changed, 10 insertions(+), 1 deletion(-)
12
13 diff --git a/config.def.h b/config.def.h
14 index 9efa774..acb43cb 100644
15 --- a/config.def.h
16 +++ b/config.def.h
17 @@ -32,7 +32,8 @@ static const Rule rules[] = {
18 };
19
20 /* layout(s) */
21 -static const float mfact = 0.55; /* factor of master area size [0.0…
22 +#define DEFAULT_MFACT 0.55
23 +static const float mfact = DEFAULT_MFACT; /* factor of master area …
24 static const int nmaster = 1; /* number of clients in master are…
25 static const int resizehints = 1; /* 1 means respect size hints in t…
26 static const int lockfullscreen = 1; /* 1 will force focus on the fulls…
27 @@ -71,6 +72,7 @@ static const Key keys[] = {
28 { MODKEY, XK_d, incnmaster, {.i …
29 { MODKEY, XK_h, setmfact, {.f …
30 { MODKEY, XK_l, setmfact, {.f …
31 + { MODKEY, XK_equal, setmfact, {.f …
32 { MODKEY, XK_Return, zoom, {0} …
33 { MODKEY, XK_Tab, view, {0} …
34 { MODKEY|ShiftMask, XK_c, killclient, {0} …
35 diff --git a/dwm.c b/dwm.c
36 index 1443802..bf3a66e 100644
37 --- a/dwm.c
38 +++ b/dwm.c
39 @@ -1521,9 +1521,16 @@ setlayout(const Arg *arg)
40 }
41
42 /* arg > 1.0 will set mfact absolutely */
43 +/* arg <= -1.0 will set mfact to DEFAULT_MFACT */
44 void
45 setmfact(const Arg *arg)
46 {
47 + if (arg->f <= -1.0) {
48 + selmon->mfact = DEFAULT_MFACT;
49 + arrange(selmon);
50 + return;
51 + }
52 +
53 float f;
54
55 if (!arg || !selmon->lt[selmon->sellt]->arrange)
56 --
57 2.47.1
58
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.