From 8e9ababec7f9678674f6aeb5c02b2490a0e28137 Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 18 Aug 2022 17:19:55 +0200 Subject: udpate --- .local/bin/status/sb-forecast | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.local/bin/status/sb-forecast b/.local/bin/status/sb-forecast index 0ac1a40..49ef4f4 100755 --- a/.local/bin/status/sb-forecast +++ b/.local/bin/status/sb-forecast @@ -2,21 +2,21 @@ weatherreport="/tmp/weatherreport" weatherglyph="/tmp/weatherglyph" -moonreport="/tmp/moonglyph" +moonglyph="/tmp/moonglyph" getweather() { curl -sf "wttr.in/Lyon" >$weatherreport || exit 1 curl -sf "wttr.in/Lyon?format=%c" >$weatherglyph || exit 1 - curl -sf "wttr.in/Lyon?format=%m" >$moonglyph || 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" \ +printf "%s%s %s" \ "$(cat $weatherglyph)" \ - "$(sed '16q;d' "$weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^/ /g;1q" | tr -d '\n')" + "$(cat $moonglyph)" \ + "$(sed '16q;d' "$weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^//g;1q" | tr -d '\n')" -moon=$(cat $moonreport) sed '13q;d' "$weatherreport" | grep -o "m\\([-+]\\)*[0-9]\\+" | sed 's/+//g' | sort -n -t 'm' -k 2n | sed -e 1b -e '$!d' | tr '\n|m' ' ' | - awk -v moon=$moon '{print " ﰕ " $1 "°C"," " $2 "°C " moon}' + awk '{print " " $1 "/" $2 "°C" moon}' -- cgit v1.2.3