From 4d731b510f698d3e1038d6acf7dcad2902620a36 Mon Sep 17 00:00:00 2001 From: waldek Date: Sat, 27 Aug 2022 16:32:03 +0200 Subject: [PATCH] more changes to the theme stuff --- theme_switch.sh | 10 ++++++++-- xonshrc | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/theme_switch.sh b/theme_switch.sh index 1e941b8..442b0d6 100644 --- a/theme_switch.sh +++ b/theme_switch.sh @@ -4,7 +4,10 @@ PATH=$PATH:~/.local/bin function set_light () { sed -i -r "/set background=/s/=.*/=light/g" ~/sources/gitea_irisib/vimrc/visual.vimrc - nvr --remote-send ":set background=light" + if ! [[ -z $(nvr --serverlist) ]]; then + nvr --remote-send ":set background=light" + fi + rm /tmp/nvimsocket 2> /dev/null 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 @@ -12,7 +15,10 @@ function set_light () { function set_dark () { sed -i -r "/set background=/s/=.*/=dark/g" ~/sources/gitea_irisib/vimrc/visual.vimrc - nvr --remote-send ":set background=dark" + if ! [[ -z $(nvr --serverlist) ]]; then + nvr --remote-send ":set background=dark" + fi + rm /tmp/nvimsocket 2> /dev/null 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 diff --git a/xonshrc b/xonshrc index 897e865..f60b803 100644 --- a/xonshrc +++ b/xonshrc @@ -42,3 +42,5 @@ xontrib load sh $PATH.append("~/.local/bin") aliases["vim"] = ["nvim", "--listen", "/tmp/nvimsocket"] +aliases["dark"] = ["bash", "~/sources/gitea_irisib/bootstrap/theme_switch.sh", "dark"] +aliases["light"] = ["bash", "~/sources/gitea_irisib/bootstrap/theme_switch.sh", "light"]