Files
RenéandGitHub 324c9a4054 Fix fontconfig monospace binding overriding app-specific fonts (#5700)
Change monospace match from mode="assign" binding="strong" to
mode="append" binding="same" so the system font acts as a fallback
instead of overriding explicit app font configs like Ghostty's font-family.

Add migration to fix existing user configs.

Fixes #5675
2026-05-11 10:15:37 +02:00

12 lines
480 B
Bash

echo "Fix fontconfig monospace binding so app-specific fonts are not overridden"
if [[ -f ~/.config/fontconfig/fonts.conf ]] && command -v xmlstarlet >/dev/null 2>&1; then
xmlstarlet ed -L \
-u '//match[@target="pattern"][test/string="monospace"]/edit[@name="family"]/@mode' \
-v "append" \
-u '//match[@target="pattern"][test/string="monospace"]/edit[@name="family"]/@binding' \
-v "same" \
~/.config/fontconfig/fonts.conf
fc-cache -f >/dev/null 2>&1
fi