feat(alacritty): use variables in theme toggling script
This commit is contained in:
parent
482ce2ef4d
commit
09e0eeac74
1 changed files with 7 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue