57 lines
1.3 KiB
Bash
Executable file
57 lines
1.3 KiB
Bash
Executable file
#!/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
|
|
|