Make sb-moonphase more robust

This commit is contained in:
appeasementPolitik 2022-10-02 16:31:25 +00:00 committed by GitHub
parent 17fe82388e
commit f3d703bd77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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")"