Make sb-forecast and sb-moonphase more robust (#1198)
* Make sb-forecast more robust * Make sb-moonphase more robust
This commit is contained in:
parent
92de5e82b3
commit
7d7872b602
2 changed files with 2 additions and 2 deletions
|
@ -29,7 +29,7 @@ esac
|
||||||
|
|
||||||
# The test if our forcecast is updated to the day. If it isn't download a new
|
# The test if our forcecast is updated to the day. If it isn't download a new
|
||||||
# weather report from wttr.in with the above function.
|
# weather report from wttr.in with the above function.
|
||||||
[ "$(stat -c %y "$weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
|
[ ! -s "$weatherreport" ] && [ "$(stat -c %y "$weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] ||
|
||||||
getforecast
|
getforecast
|
||||||
|
|
||||||
showweather
|
showweather
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
moonfile="${XDG_DATA_HOME:-$HOME/.local/share}/moonphase"
|
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 ;}
|
{ curl -sf "wttr.in/?format=%m" > "$moonfile" || exit 1 ;}
|
||||||
|
|
||||||
icon="$(cat "$moonfile")"
|
icon="$(cat "$moonfile")"
|
||||||
|
|
Loading…
Reference in a new issue