Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion bin/omarchy-font-set
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ fi
# and anything resolving "monospace" all read from here. This file is loaded
# after the package-owned default, and prepend_first puts the chosen family at
# the head of the list so it wins over the family that default prefers.
xml_escape() {
local value=$1
value=${value//&/&}
value=${value//</&lt;}
value=${value//>/&gt;}
value=${value//"/&quot;}
value=${value//'/&apos;}
printf '%s' "$value"
}

fontconfig_file="$HOME/.config/fontconfig/fonts.conf"
mkdir -p "$(dirname "$fontconfig_file")"
cat >"$fontconfig_file" <<XML
Expand All @@ -59,7 +69,7 @@ cat >"$fontconfig_file" <<XML
<string>monospace</string>
</test>
<edit name="family" mode="prepend_first" binding="strong">
<string>$font_name</string>
<string>$(xml_escape "$font_name")</string>
</edit>
</match>
</fontconfig>
Expand Down