mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
timeout forecase and moonphase at one second
This commit is contained in:
parent
a360fadd5f
commit
6e85ec18e2
@ -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() {
|
||||
|
||||
@ -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")"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user