[wiki] [sites] [dwm][patch] patch that adds limit to number of clients allowed in master area || Georgios Oxinos

From: <git_AT_suckless.org>
Date: Sun, 24 Jan 2021 17:04:19 +0100

commit 111776ee9e137fd6244ea1c253fe8cde14ce681c
Author: Georgios Oxinos <oxinosg_AT_gmail.com>
Date: Sun Jan 24 17:04:04 2021 +0100

    [dwm][patch] patch that adds limit to number of clients allowed in master area

diff --git a/dwm.suckless.org/patches/nmaxmaster/dwm-nmaxmaster-20210124-7b1c7a8.diff b/dwm.suckless.org/patches/nmaxmaster/dwm-nmaxmaster-20210124-7b1c7a8.diff
new file mode 100644
index 00000000..a5b534c3
--- /dev/null
+++ b/dwm.suckless.org/patches/nmaxmaster/dwm-nmaxmaster-20210124-7b1c7a8.diff
_AT_@ -0,0 +1,39 @@
+From 7b1c7a8c6788f28d15dbe7be330bf11bcdd16cb8 Mon Sep 17 00:00:00 2001
+From: Georgios Oxinos <georgios.oxinos.extern_AT_elinvar.de>
+Date: Sun, 24 Jan 2021 16:15:57 +0100
+Subject: [PATCH] [dwm][patch] patch that adds limit to number of clients
+ allowed in master area
+
+---
+ config.def.h | 1 +
+ dwm.c | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/config.def.h b/config.def.h
+index 1c0b587..ef895e7 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -5,6 +5,7 @@ static const unsigned int borderpx = 1; /* border pixel of windows */
+ static const unsigned int snap = 32; /* snap pixel */
+ static const int showbar = 1; /* 0 means no bar */
+ static const int topbar = 1; /* 0 means bottom bar */
++static const int nmaxmaster = 3; /* maximum number of clients allowed in master area */
+ static const char *fonts[] = { "monospace:size=10" };
+ static const char dmenufont[] = "monospace:size=10";
+ static const char col_gray1[] = "#222222";
+diff --git a/dwm.c b/dwm.c
+index 4465af1..64fd1f7 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -966,7 +966,7 @@ grabkeys(void)
+ void
+ incnmaster(const Arg *arg)
+ {
+- selmon->nmaster = MAX(selmon->nmaster + arg->i, 0);
++ selmon->nmaster = MIN(MAX(selmon->nmaster + arg->i, 0), nmaxmaster);
+ arrange(selmon);
+ }
+
+--
+2.27.0
+
diff --git a/dwm.suckless.org/patches/nmaxmaster/dwm-nmaxmaster-20210124-a04bfa8.diff b/dwm.suckless.org/patches/nmaxmaster/dwm-nmaxmaster-20210124-a04bfa8.diff
new file mode 100644
index 00000000..10e1d76a
--- /dev/null
+++ b/dwm.suckless.org/patches/nmaxmaster/dwm-nmaxmaster-20210124-a04bfa8.diff
_AT_@ -0,0 +1,39 @@
+From a04bfa8a5add2a71939e13e36797ebacd0410e0d Mon Sep 17 00:00:00 2001
+From: Georgios Oxinos <georgios.oxinos.extern_AT_elinvar.de>
+Date: Sun, 24 Jan 2021 16:12:26 +0100
+Subject: [PATCH] [dwm][patch] patch that adds limit to number of clients
+ allowed in master area
+
+---
+ config.def.h | 1 +
+ dwm.c | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/config.def.h b/config.def.h
+index 1c0b587..ef895e7 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -5,6 +5,7 @@ static const unsigned int borderpx = 1; /* border pixel of windows */
+ static const unsigned int snap = 32; /* snap pixel */
+ static const int showbar = 1; /* 0 means no bar */
+ static const int topbar = 1; /* 0 means bottom bar */
++static const int nmaxmaster = 3; /* maximum number of clients allowed in master area */
+ static const char *fonts[] = { "monospace:size=10" };
+ static const char dmenufont[] = "monospace:size=10";
+ static const char col_gray1[] = "#222222";
+diff --git a/dwm.c b/dwm.c
+index 664c527..5b61eb3 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -967,7 +967,7 @@ grabkeys(void)
+ void
+ incnmaster(const Arg *arg)
+ {
+- selmon->nmaster = MAX(selmon->nmaster + arg->i, 0);
++ selmon->nmaster = selmon->pertag->nmasters[selmon->pertag->curtag] = MIN(MAX(selmon->nmaster + arg->i, 0), nmaxmaster);
+ arrange(selmon);
+ }
+
+--
+2.27.0
+
diff --git a/dwm.suckless.org/patches/nmaxmaster/index.md b/dwm.suckless.org/patches/nmaxmaster/index.md
new file mode 100644
index 00000000..1eeef7fc
--- /dev/null
+++ b/dwm.suckless.org/patches/nmaxmaster/index.md
_AT_@ -0,0 +1,13 @@
+nmaxmaster
+==========
+
+Patch that adds limit to number of clients allowed in master area
+
+Download
+--------
+* [dwm-nmaxmaster-20210124-7b1c7a8.diff](dwm-nmaxmaster-20210124-7b1c7a8.diff)
+* [dwm-nmaxmaster-20210124-a04bfa8.diff](dwm-nmaxmaster-20210124-a04bfa8.diff) - In case pertag patch is applied
+
+Authors
+-------
+* Georgios Oxinos - <oxinosg_AT_gmail.com>
Received on Sun Jan 24 2021 - 17:04:19 CET

This archive was generated by hypermail 2.3.0 : Sun Jan 24 2021 - 17:12:50 CET