bootstrap/theme_switch.sh

39 lines
994 B
Bash
Raw Normal View History

2022-08-27 11:38:05 +02:00
#!/usr/bin/bash
PATH=$PATH:~/.local/bin
function set_light () {
sed -i -r "/set background=/s/=.*/=light/g" ~/sources/gitea_irisib/vimrc/visual.vimrc
2022-08-27 16:32:03 +02:00
if ! [[ -z $(nvr --serverlist) ]]; then
nvr --remote-send "<esc>:set background=light<enter><esc>"
fi
rm /tmp/nvimsocket 2> /dev/null
2022-08-27 11:38:05 +02:00
kitty @ set-colors -a "~/.config/kitty/solarized_light.conf"
rm ~/.config/kitty/theme.conf 2> /dev/null
ln -s ~/.config/kitty/solarized_light.conf ~/.config/kitty/theme.conf
}
function set_dark () {
sed -i -r "/set background=/s/=.*/=dark/g" ~/sources/gitea_irisib/vimrc/visual.vimrc
2022-08-27 16:32:03 +02:00
if ! [[ -z $(nvr --serverlist) ]]; then
nvr --remote-send "<esc>:set background=dark<enter><esc>"
fi
rm /tmp/nvimsocket 2> /dev/null
2022-08-27 11:38:05 +02:00
kitty @ set-colors -a "~/.config/kitty/solarized_dark.conf"
rm ~/.config/kitty/theme.conf 2> /dev/null
ln -s ~/.config/kitty/solarized_dark.conf ~/.config/kitty/theme.conf
}
case $1 in
light)
set_light
;;
dark)
set_dark
;;
*)
echo "dark or light"
;;
esac