Have Style > Font also set for Waybar, SwayOSD, and fontconfig

This commit is contained in:
David Heinemeier Hansson 2025-08-06 22:01:23 +02:00
parent 08bc9fcaea
commit 46d58ff0df
3 changed files with 13 additions and 1 deletions

View File

@ -5,6 +5,15 @@ font_name="$1"
if [[ -n "$font_name" && "$font_name" != "CNCLD" ]]; then if [[ -n "$font_name" && "$font_name" != "CNCLD" ]]; then
if fc-list | grep -iq "$font_name"; then if fc-list | grep -iq "$font_name"; then
sed -i "s/family = \".*\"/family = \"$font_name\"/g" ~/.config/alacritty/alacritty.toml sed -i "s/family = \".*\"/family = \"$font_name\"/g" ~/.config/alacritty/alacritty.toml
sed -i "s/font-family: .*/font-family: $font_name;/g" ~/.config/waybar/style.css
sed -i "s/font-family: .*/font-family: $font_name;/g" ~/.config/swayosd/style.css
xmlstarlet ed -L \
-u '//match[@target="pattern"][test/string="monospace"]/edit[@name="family"]/string' \
-v "$font_name" \
~/.config/fontconfig/fonts.conf
~/.local/share/omarchy/bin/omarchy-restart-waybar
~/.local/share/omarchy/bin/omarchy-restart-swayosd
else else
echo "Font '$font_name' not found." echo "Font '$font_name' not found."
exit 1 exit 1

View File

@ -2,7 +2,7 @@
yay -S --noconfirm --needed \ yay -S --noconfirm --needed \
wget curl unzip inetutils impala \ wget curl unzip inetutils impala \
fd eza fzf ripgrep zoxide bat jq \ fd eza fzf ripgrep zoxide bat jq xmlstarlet \
wl-clipboard fastfetch btop \ wl-clipboard fastfetch btop \
man tldr less whois plocate bash-completion \ man tldr less whois plocate bash-completion \
alacritty alacritty

3
migrations/1754509222.sh Normal file
View File

@ -0,0 +1,3 @@
echo "Add xmlstarlet needed for updating fonts via Omarchy menu"
yay -Sy --noconfirm --needed xmlstarlet