Enabling color emoticons in dwm

Colorless emoticons were bloody painful for me to enable. Most of topics on forums suggest to install fonts and stuff like that, but it never worked.

Today, however, I've found dwm fork of Stein Gunnar Bakkeby with color emoji patch (commit). It's a bit confusing, because this guy uses #define FEATURE 0 and #if !FEATURE ... #endif to enable feature (really, stop pls, just do #define FEATURE 1, it makes more sense).

Basicly, you should comment out or delete following lines in drw.c:

/* Do not allow using color fonts. This is a workaround for a BadLength
* error from Xft with color glyphs. Modelled on the Xterm workaround. See
* https://bugzilla.redhat.com/show_bug.cgi?id=1498269
* https://lists.suckless.org/dev/1701/30932.html
* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349
* and lots more all over the internet.
*/
FcBool iscol;
if (FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) {
    XftFontClose(drw->dpy, xfont);
    return NULL;
}

Enjoy colored emojis in your status bar!


Back