You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
patches/dwm/dwm-use_a_different_font_fo...

37 lines
1.2 KiB
Diff

From 9534d169827d337664c78cb34dbb16bd525a0c98 Mon Sep 17 00:00:00 2001
From: bakkeby <bakkeby@gmail.com>
Date: Fri, 4 Jun 2021 12:10:31 +0200
Subject: [PATCH] This is meant as an example patch (horrible hack) to use a
different font for the status compared to the rest of the bar.
The gist of it is that we forcibly use the second, or third, font to
draw the bar, leaving the primary (first) font to draw the rest.
---
dwm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/dwm.c b/dwm.c
index 4465af1..5e99aca 100644
--- a/dwm.c
+++ b/dwm.c
@@ -700,12 +700,16 @@ drawbar(Monitor *m)
int boxw = drw->fonts->h / 6 + 2;
unsigned int i, occ = 0, urg = 0;
Client *c;
+ Fnt *cur;
/* draw status first so it can be overdrawn by tags later */
if (m == selmon) { /* status is only drawn on selected monitor */
+ cur = drw->fonts; // remember which was the first font
+ drw->fonts = drw->fonts->next; // skip to the second font, add more of these to get to third, fourth etc.
drw_setscheme(drw, scheme[SchemeNorm]);
sw = TEXTW(stext) - lrpad + 2; /* 2px right padding */
drw_text(drw, m->ww - sw, 0, sw, bh, 0, stext, 0);
+ drw->fonts = cur; // set the normal font back to the first font
}
for (c = m->clients; c; c = c->next) {
--
2.19.1