Prevent tmux color change if it's not running

This commit is contained in:
Andrew Tomaka 2022-11-01 22:12:22 -04:00
parent 32b33a73c5
commit ee2869e335
Signed by: atomaka
GPG key ID: 61209BF70A5B18BE

View file

@ -21,10 +21,12 @@ cat $alacritty/alacritty-base.yml $alacritty/themes/$new_color.yml >> $alacritty
echo $new_color > $color_file
for pane_info in $(tmux list-panes -a -F '#{pane_id}-#{pane_current_command}'); do
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
done
fi