Get emojis working on arch linux with noto-fonts-emoji
Robin Kretzschmar

Robin Kretzschmar @darksmile92

About: Started coding at the age of 13, now a professional software engineer and Scrum Master, creating and maintaining enterprise solutions. Eat - Sleep - Code - Lift - Repeat 💪🏾

Location:
Mannheim, Germany
Joined:
Nov 14, 2017

Get emojis working on arch linux with noto-fonts-emoji

Publish Date: Jan 7 '20
52 18

After switching to arch linux as my daily driver I came across a new problem: I couldn't see emojis!

There are some emoji fonts you can install and setup. One of them is noto-fonts-emoji. I decided to write a small script to automate the setup of the font and explain the steps below:

#!/bin/sh
set -e
if [[ $(id -u) -ne 0 ]] ; then echo "Please run as root" ; exit 1 ; fi
echo "Setting up Noto Emoji font..."
# 1 - install  noto-fonts-emoji package
pacman -S noto-fonts-emoji --needed
# pacman -S powerline-fonts --needed
echo "Recommended system font: inconsolata regular (ttf-inconsolata or powerline-fonts)"
# 2 - add font config to /etc/fonts/conf.d/01-notosans.conf
echo "<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
 <alias>
   <family>sans-serif</family>
   <prefer>
     <family>Noto Sans</family>
     <family>Noto Color Emoji</family>
     <family>Noto Emoji</family>
     <family>DejaVu Sans</family>
   </prefer> 
 </alias>

 <alias>
   <family>serif</family>
   <prefer>
     <family>Noto Serif</family>
     <family>Noto Color Emoji</family>
     <family>Noto Emoji</family>
     <family>DejaVu Serif</family>
   </prefer>
 </alias>

 <alias>
  <family>monospace</family>
  <prefer>
    <family>Noto Mono</family>
    <family>Noto Color Emoji</family>
    <family>Noto Emoji</family>
    <family>DejaVu Sans Mono</family>
   </prefer>
 </alias>
</fontconfig>

" > /etc/fonts/local.conf
# 3 - update font cache via fc-cache
fc-cache
echo "Noto Emoji Font installed! You may need to restart applications like chrome. If chrome displays no symbols or no letters, your default font contains emojis."
echo "consider inconsolata regular"

Enter fullscreen mode Exit fullscreen mode

The first part is to install the package noto-fonts-emoji. The parameter --needed is used to only download and install the package, if it's not already installed.
The second part is just creating a config file and saving it.
The third part with fc-cache is the refresh of the font cache.

I recommend Inconsolata Nerd Font Mono Regular or any other font without emojis as system font. If you see numbers as emojis in your Browser, it is likely that your current system font contains emojis itself (DejaVu is one example) and you need to switch to a different font so you get the colored emojis.

Update 20.02.2020

There is a much easier way and I edited this post to contain the new information. Before there was a bit trial and error to find out the number for the font config file. With the new way, it's just one file.

Comments 18 total

  • Otávio Capila
    Otávio CapilaJul 7, 2020

    How do i revert this? My fonts seems weird now,with a lot of space between each word :/

    • Robin Kretzschmar
      Robin KretzschmarJul 7, 2020

      The easiest way would be if you have a backup of your /etc/fonts/local.conf file or didn't had this file at all before!
      In that case, either restore the backup file or delete the /etc/fonts/local.conf file completely and run fc-cache.

      In case you have no backup and had customizations in that file before, open it with an editor and remove all lines containing the emoji font (in this case e.g. Noto...). Save and run fc-cache.

  • Tim Schneeberger
    Tim SchneebergerJul 20, 2020

    Great post!
    But I noticed that <?xml version="1.0"?> evaluates to <?xml version=1.0?> (in zsh) which causes a syntax error when running fc-cache.
    The same thing happens for <!DOCTYPE fontconfig SYSTEM "fonts.dtd">. Escaping the double quotes fixes this.

    • Robin Kretzschmar
      Robin KretzschmarJul 21, 2020

      Thanks Tim, good point! Maybe I should mention that in the post :)

      • Austin Hornhead
        Austin HornheadOct 8, 2020

        I believe changing double quotes to single quotes would avoid the error from coming up. Other than that, the script is great! I've been trying to do smth like this for some time now, so thank you for writing this!

  • Chris Abraham
    Chris AbrahamAug 21, 2020

    Do you know how I could get this script working with Twitter Emoji Color (aka twemoji)?

    I replaced all lines with <family>Noto Color Emoji</family> with <family>Twitter Color Emoji</family>, but it didn't work.

    • Diamond
      DiamondSep 19, 2020

      Go into whatever your font management application is for your DE, and then search for the font's name. Whatever name shows up in the font manager is the name that you have to use in the section. It's how I found out to use JoyPixels for my emojis.

  • Pacharapol Withayasakpunt
    Pacharapol WithayasakpuntMay 2, 2021

    It works better then ArchWiki itself.

    However, it destroyed my Conkies. I have to tweak them a bit.

    Lastly, > /etc/fonts/local.conf is dangerous. You should either use a text editor or backup first.

    I would also consider using fc-cache -v, instead of fc-cache.

    Almost perfect

    Actually, only ALMOST perfect.

  • nbelakovski
    nbelakovskiFeb 13, 2022

    Thanks for this!

    I was able to get it to work by putting the local.conf file into ~/.fonts and running fc-cache without sudo. The only need for sudo is to install the package. Of course putting the file into ~/.fonts will only work for the local user, I just try to avoid sudo when I can.

  • Athithyan
    AthithyanMar 1, 2023

    worked perfectly!

  • Sergey Sarbash
    Sergey SarbashFeb 21, 2024

    Thanks a lot! Helped on Debian Bookworm.
    I little tweaked it for my own needs and it works perfectly.
    Now, KDE shows emojis within the Clipboard Manager. 👍

  • M Gomathi
    M GomathiAug 8, 2024

    Emoji

  • ADEBI Châ-Fine Ayédoun
    ADEBI Châ-Fine Ayédoun Aug 13, 2025

    Perfect timing, good job

Add comment