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-current-format "#[fg=${white},bg=${dark_purple}] #I #W "
tmux set-window-option -g window-status-format "#[fg=${white}]#[bg=${gray}] #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 & ./sleep_weather.sh &
} }

View file

@ -4,15 +4,14 @@
main() main()
{ {
while tmux has-session &> /dev/null while true
do do
./weather.sh > ~/.tmux/plugins/tmux-dracula/weather.txt ./weather.sh > ~/.tmux/plugins/tmux-dracula/weather.txt
# error=$(cat ~/.tmux/plugins/tmux-dracula/weather.txt | sed -n 2p) if tmux has-session &> /dev/null; then
# if [ $error = ' "error": {' ]; then sleep 1000
# echo "Too Many Requests" > ~/.tmux/plugins/tmux-dracula/weather.txt else
# break break
# fi fi
sleep 1000
done 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 region_code_url=http://www.ip2country.net/ip2country/region_code.html
weather_url=https://forecast.weather.gov/zipcity.php weather_url=https://forecast.weather.gov/zipcity.php
zip=46556
#substitute region code for regions in north america #substitute region code for regions in north america
get_region_code() get_region_code()
{ {