feat(alacritty): use variables in theme toggling script

This commit is contained in:
Oliver Ladner 2026-05-22 07:15:04 +02:00
commit 09e0eeac74

View file

@ -2,11 +2,16 @@
#
# Adjusts Alacritty color scheme to match macOS dark/light mode setting
# FIXME: make this work for Linux/Arch too
mode=$(defaults read -g AppleInterfaceStyle 2>/dev/null || echo "Light")
alacritty_config=~/.config/alacritty/alacritty.toml
theme_dark="kanso-ink"
theme_light="kanso-pearl"
if [ "$mode" = "Dark" ]; then
sed -i '' "s#rose-pine-dawn.toml#rose-pine-moon.toml#" $alacritty_config
# Switch to dark theme
sed -i '' "s#$theme_light.toml#$theme_dark.toml#" $alacritty_config
else
sed -i '' "s#rose-pine-moon.toml#rose-pine-dawn.toml#" $alacritty_config
# Switch to light theme
sed -i '' "s#$theme_dark.toml#$theme_light.toml#" $alacritty_config
fi