diff options
| -rwxr-xr-x | ar/.local/bin/statusbar/sb-forecast | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ar/.local/bin/statusbar/sb-forecast b/ar/.local/bin/statusbar/sb-forecast index c02e117..73f084e 100755 --- a/ar/.local/bin/statusbar/sb-forecast +++ b/ar/.local/bin/statusbar/sb-forecast @@ -29,7 +29,7 @@ getweatherreportjson() { # Forecast should be updated every 3 hours, but set 86400 to check once a day for reliability. checkforecast() { - [ -s "$1" ] && [ "$(($(date +%s) - $(stat -c %Y "$1")))" -le 86400 ] + [ -s "$1" ] && [ "$(($(date +%s) - $(stat -c %Y "$1")))" -le "$2" ] } get_current_hour() { date +%H | sed 's/^0*//'; } @@ -360,6 +360,6 @@ After $secs seconds, new clicks will also automatically update the doppler RADAR 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac -checkforecast "$weatherreport" || { getweatherreport && pkill -RTMIN+15 "${STATUSBAR:-dwmblocks}" && sleep 3; } -checkforecast "$weatherreportjson" || { getweatherreportjson && pkill -RTMIN+15 "${STATUSBAR:-dwmblocks}" && sleep 3; } +checkforecast "$weatherreport" "3600" || { getweatherreport && pkill -RTMIN+15 "${STATUSBAR:-dwmblocks}" && sleep 3; } +checkforecast "$weatherreportjson" "86400" || { getweatherreportjson && pkill -RTMIN+15 "${STATUSBAR:-dwmblocks}" && sleep 3; } showweather |
