summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
authorJoe <bousset.rudy@gmail.com>2022-08-16 16:24:45 +0200
committerJoe <bousset.rudy@gmail.com>2022-08-16 16:24:45 +0200
commit84f4c0a23705cb77b60a3663d29bc9b8716853b3 (patch)
tree0a8762d7aed5d0eca70abf7934c93d21f2a79f0b /.local/bin
parentupdae (diff)
downloaddotfiles-bsd-84f4c0a23705cb77b60a3663d29bc9b8716853b3.tar.gz
dotfiles-bsd-84f4c0a23705cb77b60a3663d29bc9b8716853b3.tar.bz2
dotfiles-bsd-84f4c0a23705cb77b60a3663d29bc9b8716853b3.tar.xz
dotfiles-bsd-84f4c0a23705cb77b60a3663d29bc9b8716853b3.tar.zst
dotfiles-bsd-84f4c0a23705cb77b60a3663d29bc9b8716853b3.zip
in progress
Diffstat (limited to '')
-rwxr-xr-x.local/bin/status/sb-forecast18
-rwxr-xr-x.local/bin/status/sb-volume2
2 files changed, 19 insertions, 1 deletions
diff --git a/.local/bin/status/sb-forecast b/.local/bin/status/sb-forecast
new file mode 100755
index 0000000..0f7aa52
--- /dev/null
+++ b/.local/bin/status/sb-forecast
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+weatherreport="/tmp/weatherreport"
+
+getweather() {
+ curl -sf "wttr.in/lyon" >$weatherreport || exit 1
+}
+
+[ -f $weatherreport ] && [ "$(gnustat -c %y "$weatherreport" 2>/dev/null | cut -d' ' -f1)" = "$(date '+%Y-%m-%d')" ] || getweather
+
+printf "%s" "$(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' ' ' |
+ awk '{print " ﰕ " $1 "°C"," " $2 "°C"}'
+
+# weatherreport="${XDG_CACHE_HOME:-$HOME/.cache}/weatherreport"
diff --git a/.local/bin/status/sb-volume b/.local/bin/status/sb-volume
index f7b3cb1..aefad80 100755
--- a/.local/bin/status/sb-volume
+++ b/.local/bin/status/sb-volume
@@ -20,4 +20,4 @@ else
micon=""
fi
-echo "$icon | $micon"
+echo "$micon $icon "