summaryrefslogtreecommitdiffstats
path: root/.local/bin/statusbar
diff options
context:
space:
mode:
authorappeasementPolitik <108810900+appeasementPolitik@users.noreply.github.com>2022-10-02 19:22:00 +0000
committerGitHub <noreply@github.com>2022-10-02 19:22:00 +0000
commit7d7872b602adc8be021bf25b02f2372e87290aa2 (patch)
tree03e853a18acc209f714fde5ac4b7b72a1f408c7b /.local/bin/statusbar
parent92de5e82b365dc027bf10f1f28e77b5e784e9992 (diff)
downloadeibhear-7d7872b602adc8be021bf25b02f2372e87290aa2.tar.gz
eibhear-7d7872b602adc8be021bf25b02f2372e87290aa2.tar.zst
eibhear-7d7872b602adc8be021bf25b02f2372e87290aa2.zip
Make sb-forecast and sb-moonphase more robust (#1198)
* Make sb-forecast more robust * Make sb-moonphase more robust
Diffstat (limited to '.local/bin/statusbar')
-rwxr-xr-x.local/bin/statusbar/sb-forecast2
-rwxr-xr-x.local/bin/statusbar/sb-moonphase2
2 files changed, 2 insertions, 2 deletions
diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast
index 45584c5..af77d2c 100755
--- a/.local/bin/statusbar/sb-forecast
+++ b/.local/bin/statusbar/sb-forecast
@@ -29,7 +29,7 @@ esac
# 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.
-[ "$(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
showweather
diff --git a/.local/bin/statusbar/sb-moonphase b/.local/bin/statusbar/sb-moonphase
index fab8b4d..5eb1875 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")"