Refactor switch-theme using kitty theme-switcher

This commit is contained in:
2022-05-02 12:44:06 +02:00
parent 80e5f3e090
commit cb6d36b983
5 changed files with 24 additions and 26 deletions

View File

@@ -8,24 +8,23 @@ fi
mode=$1
capitalize() {
printf '%s' "$1" | head -c 1 | tr [:lower:] [:upper:]
printf '%s' "$1" | tail -c '+2'
}
change_theme() {
sed -i "s/iceberg_$1/iceberg_$2/" ~/.config/kitty/kitty.conf
sed -i "s/bg=$1/bg=$2/" ~/.config/nvim/init.vim
sed -i "s/iceberg_$1/iceberg_$2/" ~/.dotfiles/tmux/.tmux.conf
}
reload_kitty() {
pkill kitty
kitty +kitten themes --reload-in=all "Iceberg $(capitalize "$2")"
tmux source-file ~/.tmux.conf
kitty --class tmux tmux a
}
if [ "$mode" = "light" ]; then
emacsclient --eval "(load-theme 'doom-nord-light 'no-confirm)"
change_theme dark light
reload_kitty
else
emacsclient --eval "(load-theme 'doom-nord 'no-confirm)"
change_theme light dark
reload_kitty
fi