#!/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