timeout forecase and moonphase at one second

This commit is contained in:
Joseph Kerkhof 2023-08-28 18:14:28 -05:00
parent a360fadd5f
commit 6e85ec18e2
No known key found for this signature in database
GPG Key ID: 71A696CAC91CEA76
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ url="${WTTRURL:-wttr.in}"
weatherreport="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport"
# Get a weather report from 'wttr.in' and save it locally.
getforecast() { curl -sf "$url/$LOCATION" > "$weatherreport" || exit 1; }
getforecast() { curl -sfm 1 "$url/$LOCATION" > "$weatherreport" || exit 1; }
# Forecast should be updated only once a day.
checkforecast() {

View File

@ -5,7 +5,7 @@
moonfile="${XDG_DATA_HOME:-$HOME/.local/share}/moonphase"
[ -s "$moonfile" ] && [ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
{ curl -sf "wttr.in/?format=%m" > "$moonfile" || exit 1 ;}
{ curl -sfm 1 "wttr.in/?format=%m" > "$moonfile" || exit 1 ;}
icon="$(cat "$moonfile")"