From a004cdd76dc032970c98a46807f9e1d11e00b5a0 Mon Sep 17 00:00:00 2001
From: Fabian Schmidt <fabschmidt@protonmail.com>
Date: Sat, 30 May 2020 22:13:12 +0200
Subject: [PATCH] Added a distro symbol (similar to what you'll find in DEs).
 Not yet functional.

---
 config.def.h | 1 +
 dwm.c        | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/config.def.h b/config.def.h
index 1c0b587..c32900d 100644
--- a/config.def.h
+++ b/config.def.h
@@ -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 char *distrosymbol     = "";
 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 9fd0286..0a0c5cb 100644
--- a/dwm.c
+++ b/dwm.c
@@ -113,6 +113,7 @@ typedef struct {
 
 struct Monitor {
 	char ltsymbol[16];
+    char distrosymbol[16];
 	float mfact;
 	int nmaster;
 	int num;
@@ -431,7 +432,8 @@ buttonpress(XEvent *e)
 		focus(NULL);
 	}
 	if (ev->window == selmon->barwin) {
-		i = x = 0;
+        x = TEXTW(m->distrosymbol);
+		i = 0;
 		do
 			x += TEXTW(tags[i]);
 		while (ev->x >= x && ++i < LENGTH(tags));
@@ -642,6 +644,7 @@ createmon(void)
 	m->lt[0] = &layouts[0];
 	m->lt[1] = &layouts[1 % LENGTH(layouts)];
 	strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
+    strncpy(m->distrosymbol, distrosymbol, sizeof m->distrosymbol);
 	return m;
 }
 
@@ -715,6 +718,9 @@ drawbar(Monitor *m)
 			urg |= c->tags;
 	}
 	x = 0;
+	w = blw = TEXTW(m->distrosymbol);
+	drw_setscheme(drw, scheme[SchemeNorm]);
+	x = drw_text(drw, x, 0, w, bh, lrpad / 2, m->distrosymbol, 0);
 	for (i = 0; i < LENGTH(tags); i++) {
 		w = TEXTW(tags[i]);
 		drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);