From 17838e31561ee8ed2c1c44b03f0129406753e62d Mon Sep 17 00:00:00 2001
From: Joe <bousset.rudy@gmail.com>
Date: Fri, 2 Sep 2022 16:51:24 +0200
Subject: up

---
 .local/bin/status/sb-clock    |  2 +-
 .local/bin/status/sb-forecast | 18 +++++++-----------
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/.local/bin/status/sb-clock b/.local/bin/status/sb-clock
index 6313e49..faecfc0 100755
--- a/.local/bin/status/sb-clock
+++ b/.local/bin/status/sb-clock
@@ -1,4 +1,4 @@
-#!/usr/local/bin/dash
+#!/bin/sh
 
 clock=$(date '+%I')
 
diff --git a/.local/bin/status/sb-forecast b/.local/bin/status/sb-forecast
index 08b788d..413a280 100755
--- a/.local/bin/status/sb-forecast
+++ b/.local/bin/status/sb-forecast
@@ -1,20 +1,16 @@
 #!/bin/sh
 
-weatherreport="/tmp/weatherreport"
-weatherglyph="/tmp/weatherglyph"
-moonglyph="/tmp/moonglyph"
+# weatherreport="/tmp/weatherreport"
+# weatherglyph="/tmp/weatherglyph"
+# moonglyph="/tmp/moonglyph"
 
-getweather() {
-	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
+weatherreport=$(curl -sf "wttr.in/Lyon" 2>&1 || exit 1) # >$weatherreport || (rm -f $weatherreport && exit 1)
+weatherglyph=$(curl -sf "wttr.in/Lyon?format=%c" 2>&1 || exit 1) # >$weatherglyph || exit 1
+moonglyph=$(curl -sf "wttr.in/?format=%m" 2>&1 || exit 1) # >$moonglyph || exit 1
 
 printf "%s%s" \
 	"$(cat $weatherglyph)" \
-	"$(sed '16q;d' "$weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^//g;1q" | tr -d '\n')" \
+	"$(sed '16q;d' "$weatherreport" | grep -wo "[0-9]*%" | sort -rn | sed "s/^/ /g;1q" | tr -d '\n')"
 
 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' ' ' |
-- 
cgit v1.2.3