From 9fcf4515b86e7649c0befb6a495aa43bf8f2c22a Mon Sep 17 00:00:00 2001 From: Sabato Luca Guadagno Date: Thu, 22 Jul 2021 12:17:11 +0200 Subject: [PATCH] wait for $datafile if weather plugin is active --- scripts/dracula.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 7c9f70e..e830d65 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -113,12 +113,6 @@ main() # status bar tmux set-option -g status-style "bg=${gray},fg=${white}" - # wait unit $datafile exists just to avoid errors - # this should almost never need to wait unless something unexpected occurs - while $show_weather && [ ! -f $datafile ]; do - sleep 0.01 - done - # Status left if $show_powerline; then tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ${left_icon} #[fg=${green},bg=${gray}]#{?client_prefix,#[fg=${yellow}],}${left_sep}" @@ -164,6 +158,12 @@ main() fi if [ $plugin = "weather" ]; then + # wait unit $datafile exists just to avoid errors + # this should almost never need to wait unless something unexpected occurs + while [ ! -f $datafile ]; do + sleep 0.01 + done + IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-weather-colors" "orange dark_gray") script="#(cat $datafile)" fi