From 92d3560888279fad9df63a4295b55b01522112cd Mon Sep 17 00:00:00 2001 From: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Date: Fri, 18 Aug 2023 21:21:44 +0000 Subject: [PATCH] Robustness not needed anymore because of curl's --output, no more empty files --- .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 fd224705..91592ca8 100755 --- a/.local/bin/statusbar/sb-forecast +++ b/.local/bin/statusbar/sb-forecast @@ -11,7 +11,7 @@ getforecast() { curl -sf "$url/$LOCATION" --output "$weatherreport" && touch "$w # Forecast should be updated only once a day. checkforecast() { - [ -s "$weatherreport" ] && [ "$(stat -c %y "$weatherreport" 2>/dev/null | + [ "$(stat -c %y "$weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] } diff --git a/.local/bin/statusbar/sb-moonphase b/.local/bin/statusbar/sb-moonphase index 49201130..26e3f13f 100755 --- a/.local/bin/statusbar/sb-moonphase +++ b/.local/bin/statusbar/sb-moonphase @@ -4,7 +4,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')" ] || +[ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || { [ -z "$(pgrep 'sb-moonphase' | tail -n +3)" ] && ( until { [ "$(cat /sys/class/net/w*/operstate)" = 'up' ] || [ "$(cat /sys/class/net/e*/operstate)" = 'up' ]; } && curl -sf "wttr.in/?format=%m" --output "$moonfile" && touch "$moonfile"; do sleep 60; done &&