dwm-nmaxmaster-20210124-7b1c7a8.diff (1366B)
1 From 7b1c7a8c6788f28d15dbe7be330bf11bcdd16cb8 Mon Sep 17 00:00:00 2001 2 From: Georgios Oxinos <georgios.oxinos.extern@elinvar.de> 3 Date: Sun, 24 Jan 2021 16:15:57 +0100 4 Subject: [PATCH] [dwm][patch] patch that adds limit to number of clients 5 allowed in master area 6 7 --- 8 config.def.h | 1 + 9 dwm.c | 2 +- 10 2 files changed, 2 insertions(+), 1 deletion(-) 11 12 diff --git a/config.def.h b/config.def.h 13 index 1c0b587..ef895e7 100644 14 --- a/config.def.h 15 +++ b/config.def.h 16 @@ -5,6 +5,7 @@ static const unsigned int borderpx = 1; /* border pixel of windows */ 17 static const unsigned int snap = 32; /* snap pixel */ 18 static const int showbar = 1; /* 0 means no bar */ 19 static const int topbar = 1; /* 0 means bottom bar */ 20 +static const int nmaxmaster = 3; /* maximum number of clients allowed in master area */ 21 static const char *fonts[] = { "monospace:size=10" }; 22 static const char dmenufont[] = "monospace:size=10"; 23 static const char col_gray1[] = "#222222"; 24 diff --git a/dwm.c b/dwm.c 25 index 4465af1..64fd1f7 100644 26 --- a/dwm.c 27 +++ b/dwm.c 28 @@ -966,7 +966,7 @@ grabkeys(void) 29 void 30 incnmaster(const Arg *arg) 31 { 32 - selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); 33 + selmon->nmaster = MIN(MAX(selmon->nmaster + arg->i, 0), nmaxmaster); 34 arrange(selmon); 35 } 36 37 -- 38 2.27.0 39