Merge pull request #203 from miknikif/feature/fix-weather-script

This commit is contained in:
Ethan Edwards 2023-04-24 08:39:06 -04:00 committed by GitHub
commit 6de48667f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 62 deletions

View file

@ -7,8 +7,6 @@ source $current_dir/utils.sh
main()
{
datafile=/tmp/.dracula-tmux-data
# set configuration option variables
show_fahrenheit=$(get_tmux_option "@dracula-show-fahrenheit" true)
show_location=$(get_tmux_option "@dracula-show-location" true)
@ -67,11 +65,6 @@ main()
left_sep="$show_left_sep"
fi
# start weather script in background
if [[ "${plugins[@]}" =~ "weather" ]]; then
$current_dir/sleep_weather.sh $show_fahrenheit $show_location $fixed_location &
fi
# Set timezone unless hidden by configuration
case $show_timezone in
false)
@ -186,14 +179,8 @@ main()
script="#($current_dir/kubernetes_context.sh $show_kubernetes_context_label)"
elif [ $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)"
script="#($current_dir/weather_wrapper.sh $show_fahrenheit $show_location $fixed_location)"
elif [ $plugin = "time" ]; then
IFS=' ' read -r -a colors <<< $(get_tmux_option "@dracula-time-colors" "dark_purple white")