markhuge MH\n s

Fontconfig Dotfiles


signed with 0x683A22F9469CA4EB


If you’re using a minimal Linux distro, you’ve probably noticed that your fonts are pretty wonky out of the box.

Override default monospace font

The fallback for pretty much everything that displays code or terminal output is “monospace”. Instead of setting up overrides in individual applications, you can just override it globally (for your user) in fontconfig.

In this example we return “Source Code Pro” whenever we match mono.


<?xml version="1.0"?><!DOCTYPE fontconfig SYSTEM "fonts.dtd">
        <prefer><family>Source Code Pro</family></prefer>

Your browsers will use this font for rendering otherwise unstyled monospace content (<pre> and <code> tags for example).

If you use suckless utils, most of them hardcode a font name at compile time. With this, you can set all of them to “mono” in your builds, and it’ll use the override. Now you can ditch the Xresources patch!

About the Author

Mark Wilkerson


R&D engineer @ Twitch. Previously Blizzard, Hightail, Co-Founder @ SpeakUp

Mark is building open source tools to make web3 and decentralized self-ownership easy for regular people.

Live dev streams at

More Posts