Skip to content

Commit

Permalink
wait for $datafile if weather plugin is active
Browse files Browse the repository at this point in the history
  • Loading branch information
o0th committed Jul 22, 2021
1 parent 58619bd commit 9fcf451
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/dracula.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 9fcf451

Please sign in to comment.