1
0
Fork 0
dotfiles/simpleDots/bin/switchTermColours.sh

58 lines
1.3 KiB
Bash
Raw Normal View History

2021-06-26 13:50:32 +02:00
#!/bin/sh
###############################################################################
##
# Switch alacritty colourscheme from light to dark and back
#
#
#
###############################################################################
if [ ! -d ~/.config/alacritty ]
then
echo "Alacritty config dir not found."
exit 1
fi
if [ ! -f ~/.config/alacritty/sourcerer.colourscheme ]
then
echo "Expected Sourcerer colourscheme not fround."
exit 1
fi
if [ ! -f ~/.config/alacritty/ayu-light.colourscheme ]
then
echo "Expected AYU-Light colourscheme not fround."
exit 1
fi
grep --fixed-strings --silent '~/.config/alacritty/active_colourscheme.yml' ~/.config/alacritty/alacritty.yml
rc=$?
if [ $rc -ne 0 ]
then
echo "Include for colourscheme not found in config."
exit 1
fi
cd ~/.config/alacritty
if [ ! -L active_colourscheme.yml ]
then
rm -f active_colourscheme.yml
ln --force --symbolic sourcerer.colourscheme active_colourscheme.yml
exit 0
fi
if [ $(readlink active_colourscheme.yml) -ef sourcerer.colourscheme ]
then
ln --force --symbolic ayu-light.colourscheme active_colourscheme.yml
exit 0
fi
if [ $(readlink active_colourscheme.yml) -ef ayu-light.colourscheme ]
then
ln --force --symbolic sourcerer.colourscheme active_colourscheme.yml
exit 0
fi