[hackers] [dwm][PATCH] Make monocle-layout symbol static

From: aleks <aleks.stier_AT_icloud.com>
Date: Tue, 9 Apr 2019 10:05:56 +0200

dwm only uses the monocle-layout symbol, which is defined in the
config.h, when no clients are open. Otherwise, dwm prints the number
of opened clients. This patch makes dwm use the symbol as defined by
the user in the config.h regardless of how many clients are open.

I created this patch because I find an icon as a symbol aesthetically
more pleasant than numbers and because I don't need to know the exact
number of opened clients all the time. Additionally, this patch makes
the code simpler because it only removes code.
---
 dwm.c | 6 ------
 1 file changed, 6 deletions(-)
diff --git a/dwm.c b/dwm.c
index 4465af1..3b98778 100644
--- a/dwm.c
+++ b/dwm.c
_AT_@ -1103,14 +1103,8 @@ maprequest(XEvent *e)
 void
 monocle(Monitor *m)
 {
-	unsigned int n = 0;
 	Client *c;
 
-	for (c = m->clients; c; c = c->next)
-		if (ISVISIBLE(c))
-			n++;
-	if (n > 0) /* override layout symbol */
-		snprintf(m->ltsymbol, sizeof m->ltsymbol, "[%d]", n);
 	for (c = nexttiled(m->clients); c; c = nexttiled(c->next))
 		resize(c, m->wx, m->wy, m->ww - 2 * c->bw, m->wh - 2 * c->bw, 0);
 }
-- 
2.21.0
Received on Tue Apr 09 2019 - 10:05:56 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 09 2019 - 10:12:23 CEST