How to have colored emojis in dmenu, st, dwm and slstatus on Archlinux

[linkstandalone]

I was using slstatus, dwn, st and dmenu for a while and I didn't understand why some emojis were displaying correctly while others were black and white. Consistency was broken.

The true answer was that I half-assed the setup. I'm going to explain you how to do it properly to avoid hair loss and headaches.


  1. Be sure to have fakeroot or sudo installed because we'll compile packages from the AUR thanks to makepkg -s.
  2. Download and compile the patched version of libxft by Maxime Coste: libxft-bgra-git.
    Install it by executing the following:
    curl -OJL https://aur.archlinux.org/cgit/aur.git/snapshot/libxft-bgra-git.tar.gz
    tar xvzf libxft-bgra-git.tar.gz
    cd libxft-bgra-git/
    makepkg -s
    pacman -U libxft-bgra-git*.pkg.tar.zst

    When asked to remove libxft (conflicts), do it.
  3. We now need to choose an emoji font. There are some like noto-fonts-emoji, ttf-joypixels, ttf-twemoji. In my case, I've chosen the ttf-twemoji font.
    If you've chosen it too don't forget to copy 75-twemoji.conf in the /etc/fonts/conf.d directory. Execute pacman -U ttf-twemoji*.pkg.tar.xz where you compiled ttf-twemoji in order to install it.
  4. Don't forget to comment out or delete the lines 142 to 146 in the drw.c file in both dwm and dmenu source code when recompiling because if you don't, emojis won't display correctly or at all.
  5. You are done! You can now test your setup against a simple script outputting an emoji list :
    curl -OJL https://github.com/LukeSmithxyz/voidrice/raw/master/.local/share/larbs/emoji
    mv emoji ~/.local/share/emojis
    cat ~/.local/share/emojis | dmenu -i -b -l 5


Many thanks to Luke Smith for the convenient emoji list and Unicode for emoji standardisation. Very 🆒.