Remove old color swap stuff

This commit is contained in:
Andrew Tomaka 2024-12-31 12:30:36 -05:00
parent 61c854604d
commit 5d465408c5
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE
2 changed files with 1 additions and 42 deletions

View file

@ -1,31 +1,3 @@
#!/bin/bash
color_file=$HOME/.config/$USER/color.yml
if ! test -f $color_file; then
mkdir -p $HOME/.config/$USER
echo light > $color_file
fi
old_color=$(cat $color_file)
if [[ $old_color == "dark" ]]; then
new_color=light
else
new_color=dark
fi
alacritty=$HOME/.config/alacritty/
ln -sf $alacritty/themes/$new_color.toml $alacritty/theme.toml
# Alacritty does not notice update of imported symlink
touch $alacritty/alacritty.toml
echo $new_color > $color_file
if tmux info &> /dev/null; then
for pane_info in $(tmux list-panes -a -F '#{pane_id}-#{pane_current_command}'); do
IFS=- read pane cmd <<< "$pane_info"
if [[ $cmd == "vim" || $cmd == "nvim" ]]; then
tmux send-keys -t $pane ":lua ChangeBackground()" ENTER
fi
done
fi
osascript -e 'tell app "System Events" to tell appearance preferences to set dark mode to not dark mode'