statuscmd - bakkeby/patches GitHub Wiki

This is a variant of the https://dwm.suckless.org/patches/statuscmd/ patch that aims to be simpler and less invasive compared to the original.

The main difference here is this change to drw.c that skips control characters both when drawing text as well as when calculating the text width.

@@ -268,6 +268,13 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
 		nextfont = NULL;
 		while (*text) {
 			utf8charlen = utf8decode(text, &utf8codepoint, &utf8err);
+
+			/* Skip control characters */
+			if (utf8codepoint < ' ') {
+				text++;
+				break;
+			}
+
 			for (curfont = drw->fonts; curfont; curfont = curfont->next) {
 				charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint);
 				if (charexists) {

As such there is no need for changes to drawbar and updatestatus.

Functionally the two patches should be identical, but this should cause less conflicts due to the reduced amount of code changes.

On a separate note the change to drw.c highlighted above also applies to the statuscolors patch which leaks space because TEXTW otherwise takes the control characters into account when calculating the text width.

Download

⚠️ **GitHub.com Fallback** ⚠️