DEV Community

Cover image for Setting Up Nerd Fonts in Alacritty on Ubuntu
RayMiles
RayMiles

Posted on

Setting Up Nerd Fonts in Alacritty on Ubuntu

1. Download & Install the Nerd Font

# Create fonts directory
mkdir -p ~/.local/share/fonts

# Download JetBrainsMono Nerd Font (or any you prefer)
wget https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.zip

# Unzip
unzip JetBrainsMono.zip -d ~/.local/share/fonts/JetBrainsMono

# Refresh font cache
fc-cache -fv
Enter fullscreen mode Exit fullscreen mode

2. Verify the Exact Font Name

fc-list | grep -i "JetBrains"
Enter fullscreen mode Exit fullscreen mode

You should see output like:

~/.local/share/fonts/JetBrainsMono/JetBrainsMonoNerdFont-Regular.ttf: JetBrainsMono Nerd Font:style=Regular
~/.local/share/fonts/JetBrainsMono/JetBrainsMonoNerdFontMono-Regular.ttf: JetBrainsMono Nerd Font Mono:style=Regular
Enter fullscreen mode Exit fullscreen mode

✅ Use → JetBrainsMono Nerd Font
❌ Avoid → JetBrainsMono Nerd Font Mono

3. Configure Alacritty

# Create config directory if it doesn't exist
mkdir -p ~/.config/alacritty

# Open config file
nano ~/.config/alacritty/alacritty.toml
Enter fullscreen mode Exit fullscreen mode

Add this to the file:

[font]
size = 13.0

[font.normal]
family = "JetBrainsMono Nerd Font"
style = "Regular"

[font.bold]
family = "JetBrainsMono Nerd Font"
style = "Bold"

[font.italic]
family = "JetBrainsMono Nerd Font"
style = "Italic"

[font.bold_italic]
family = "JetBrainsMono Nerd Font"
style = "Bold Italic"
Enter fullscreen mode Exit fullscreen mode

Save with Ctrl+OEnterCtrl+X

4. Install Alacritty (if not yet installed)

# Ubuntu 22.04+
sudo apt install alacritty

# Or via snap
sudo snap install alacritty --classic
Enter fullscreen mode Exit fullscreen mode

5. Restart Alacritty

# Simply close and reopen, or:
alacritty &
Enter fullscreen mode Exit fullscreen mode

That's it! Your icons in tools like Starship, lsd, eza, or Neovim should now render at full size. 🎉

Top comments (0)