32 lines
638 B
Bash
Executable File
32 lines
638 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ $# -lt 1 ]; then
|
|
echo "Usage: switch_theme <mode>"
|
|
echo "mode: dark|light"
|
|
exit 1
|
|
fi
|
|
|
|
mode=$1
|
|
|
|
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
|
|
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
|