1
0
Fork 0
dotfiles2000/dotfiles/my-binaries/dot-bin/switchTermColours.sh
2024-10-31 22:09:39 +01:00

32 lines
810 B
Bash
Executable file

#!/bin/sh
###############################################################################
##
# Switch alacritty colourscheme
#
###############################################################################
theme=$(ls -1 ~/.config/alacritty/color | rofi -dmenu -p "Select alacritty theme")
rc=$?
echo "Selected theme: ~/.config/alacritty/color/$theme"
## Exit if error in selection (e.g. ESC)
if [ $rc -ne 0 ]
then
echo "Operation canceled."
echo ""
exit 125
fi
## Exit if selection is no file from the colors directory
if [ ! -f ~/.config/alacritty/color/$theme ]
then
echo "Selected theme not found."
echo ""
exit 2
fi
#sed -i "{s+.*#MARK-color$+import = [\"color/$theme\"] #MARK-color+}" ~/.config/alacritty/alacritty.toml
ln -fs ~/.config/alacritty/color/$theme ~/.local/alacritty_colors.toml