alacritty: add script to adjust alacritty theme based on macOS dark/light mode setting

This commit is contained in:
Oliver Ladner 2024-08-16 10:23:41 +02:00
commit c1fce985b8

12
bin/alacritty-toggle.sh Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
#
# Adjusts Alacritty color scheme to match macOS dark/light mode setting
mode=$(defaults read -g AppleInterfaceStyle 2>/dev/null || echo "Light")
alacritty_config=~/.config/alacritty/alacritty.toml
if [ "$mode" = "Dark" ]; then
sed -i '' "s#tokyonight_day.toml#tokyonight_moon.toml#" $alacritty_config
else
sed -i '' "s#tokyonight_moon.toml#tokyonight_day.toml#" $alacritty_config
fi