summaryrefslogtreecommitdiffstats
path: root/.scripts/cron/getforecast
diff options
context:
space:
mode:
Diffstat (limited to '.scripts/cron/getforecast')
-rwxr-xr-x.scripts/cron/getforecast6
1 files changed, 6 insertions, 0 deletions
diff --git a/.scripts/cron/getforecast b/.scripts/cron/getforecast
new file mode 100755
index 0000000..2760c89
--- /dev/null
+++ b/.scripts/cron/getforecast
@@ -0,0 +1,6 @@
+#!/bin/sh
+# Updates weather forecast
+ping -q -w 1 -c 1 "$(ip r | grep default | tail -1 | cut -d ' ' -f 3)" >/dev/null || exit
+location="$1"; [ -z "$location" ] || location="$location+"
+curl -s "wttr.in/$location" > ~/.weatherreport
+pkill -RTMIN+5 i3blocks && notify-send "🌞 Weather forecast updated."