From 09e0eeac74b6894bc9b1d43619dcc10f338fb09b Mon Sep 17 00:00:00 2001 From: Oliver Ladner Date: Fri, 22 May 2026 07:15:04 +0200 Subject: [PATCH] feat(alacritty): use variables in theme toggling script --- bin/alacritty-toggle.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/alacritty-toggle.sh b/bin/alacritty-toggle.sh index 6624aa9..695b477 100755 --- a/bin/alacritty-toggle.sh +++ b/bin/alacritty-toggle.sh @@ -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