summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
authorJoe <bousset.rudy@gmail.com>2022-08-22 12:22:03 +0200
committerJoe <bousset.rudy@gmail.com>2022-08-22 12:22:03 +0200
commitae91fbcbbbdc6f04ec62bb11bb7c422e867f4e07 (patch)
tree9363e8b3c6581642959df84246dc58ad69e29ee7 /.local/bin
parentupdate (diff)
downloaddotfiles-bsd-ae91fbcbbbdc6f04ec62bb11bb7c422e867f4e07.tar.gz
dotfiles-bsd-ae91fbcbbbdc6f04ec62bb11bb7c422e867f4e07.tar.bz2
dotfiles-bsd-ae91fbcbbbdc6f04ec62bb11bb7c422e867f4e07.tar.xz
dotfiles-bsd-ae91fbcbbbdc6f04ec62bb11bb7c422e867f4e07.tar.zst
dotfiles-bsd-ae91fbcbbbdc6f04ec62bb11bb7c422e867f4e07.zip
update
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/status/sb-forecast4
1 files changed, 2 insertions, 2 deletions
diff --git a/.local/bin/status/sb-forecast b/.local/bin/status/sb-forecast
index b022048..317b502 100755
--- a/.local/bin/status/sb-forecast
+++ b/.local/bin/status/sb-forecast
@@ -5,14 +5,14 @@ weatherglyph="/tmp/weatherglyph"
moonglyph="/tmp/moonglyph"
getweather() {
- curl -sf "wttr.in/Lyon" >$weatherreport || exit 1
+ curl -sf "wttr.in/Lyon" >$weatherreport || (rm -f $weatherreport && exit 1)
curl -sf "wttr.in/Lyon?format=%c" >$weatherglyph || exit 1
curl -sf "wttr.in/?format=%m" >$moonglyph || exit 1
}
[ -f $weatherreport ] && [ "$(gnustat -c %y "$weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || getweather
-printf "%s%s %s" \
+printf "%s%s %s" \
"$(cat $weatherglyph)" \
"$(cat $moonglyph)" \
"$(sed '16q;d' "$weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^/ /g;1q" | tr -d '\n')"