From f3d703bd776a3d81d25ea1528384112914e87afc Mon Sep 17 00:00:00 2001 From: appeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com> Date: Sun, 2 Oct 2022 16:31:25 +0000 Subject: [PATCH] Make sb-moonphase more robust --- .local/bin/statusbar/sb-moonphase | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-moonphase b/.local/bin/statusbar/sb-moonphase index fab8b4da..5eb1875c 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" -[ "$(stat -c %y "$moonfile" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || +[ ! -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 ;} icon="$(cat "$moonfile")"