Emoji Support in Dunst
TL;DR
- Install an emoji font
- Restart Dunst
- Optional: explicitly configure
~/.config/dunst/dunstrc
to include the font
A little more context
Although I've used Dunst for a couple of years, it wasn't until recently that I realised I wanted emoji support.
It came about when I switched over from Chromium to Firefox Nightly, and found that the WhatsApp Web interface would send notifications via Dunst. For instance, I would receive a popup similar to:
As you can see, instead of receiving a pictogram representing "Woman Gesturing OK", I was able to see the raw Unicode representation.
It turns out the lack of emojis showing was due to me not having any emoji fonts installed on my system. Following the Fonts page on the Arch Wiki I found that as I liked Google's emoji, and they were packaged nicely, I would use them.
Once installed, I found that the font would automagically get loaded into Dunst and would render notifications correctly:
Just to ensure this would always reference this font (i.e. in the case multiple emoji fonts were installed), I configured Dunst by adding the following configuration in ~/.config/dunst/dunstrc
:
[global]
- font = Liberation Mono
+ font = Liberation Mono, Noto Emoji 12
To determine the font name to use, I ran the following command, and noted the name between the colons:
$ fc-list | grep -i noto
/usr/share/fonts/noto/NotoEmoji-Regular.ttf: Noto Emoji:style=Regular
/usr/share/fonts/noto/NotoColorEmoji.ttf: Noto Color Emoji:style=Regular
$ fc-list | grep -i noto | cut -f2 -d: | cut -c2-
Noto Emoji
Noto Color Emoji