Remove old color swap stuff
This commit is contained in:
parent
61c854604d
commit
5d465408c5
2 changed files with 1 additions and 42 deletions
|
@ -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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue