From 6e85ec18e2a8a36c562892280b8fc647ffe47f3a Mon Sep 17 00:00:00 2001 From: Joseph Kerkhof Date: Mon, 28 Aug 2023 18:14:28 -0500 Subject: [PATCH] timeout forecase and moonphase at one second --- .local/bin/statusbar/sb-forecast | 2 +- .local/bin/statusbar/sb-moonphase | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast index 368c17f7..d36a6be1 100755 --- a/.local/bin/statusbar/sb-forecast +++ b/.local/bin/statusbar/sb-forecast @@ -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() { diff --git a/.local/bin/statusbar/sb-moonphase b/.local/bin/statusbar/sb-moonphase index 99adaee8..42346225 100755 --- a/.local/bin/statusbar/sb-moonphase +++ b/.local/bin/statusbar/sb-moonphase @@ -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")"