fixed sleep command bug

This commit is contained in:
Dane Williams 2020-03-15 12:41:10 -07:00
parent 68764b514b
commit 4362eaa8d7
3 changed files with 7 additions and 9 deletions

View file

@ -51,6 +51,7 @@ main()
tmux set-window-option -g window-status-current-format "#[fg=${white},bg=${dark_purple}] #I #W "
tmux set-window-option -g window-status-format "#[fg=${white}]#[bg=${gray}] #I #W "
# run weather update script in background
./sleep_weather.sh &
}

View file

@ -4,15 +4,14 @@
main()
{
while tmux has-session &> /dev/null
while true
do
./weather.sh > ~/.tmux/plugins/tmux-dracula/weather.txt
# error=$(cat ~/.tmux/plugins/tmux-dracula/weather.txt | sed -n 2p)
# if [ $error = ' "error": {' ]; then
# echo "Too Many Requests" > ~/.tmux/plugins/tmux-dracula/weather.txt
# break
# fi
if tmux has-session &> /dev/null; then
sleep 1000
else
break
fi
done
}

View file

@ -12,8 +12,6 @@ country=$(curl -s https://ipinfo.io/country 2> /dev/null)
region_code_url=http://www.ip2country.net/ip2country/region_code.html
weather_url=https://forecast.weather.gov/zipcity.php
zip=46556
#substitute region code for regions in north america
get_region_code()
{