dotfiles/dot_bin/executable_alacritty_theme

25 lines
504 B
Plaintext
Raw Normal View History

#!/bin/bash
config=$XDG_CONFIG_HOME/alacritty/alacritty.toml
light=$config.light
dark=$config.dark
if [[ "$1" == "toggle" ]]; then
current=$(readlink $config)
if [ $current == $light ]; then
ln -sf $dark $config
elif [ $current == $dark ]; then
ln -sf $light $config
else
echo 'Invalid link'
exit 1
fi
elif [[ "$1" == "dark" ]]; then
ln -sf $dark $config
elif [[ "$1" == "light" ]]; then
ln -sf $light $config
else
echo 'Invalid command'
exit 1
fi