voidrice/.scripts/cron/getforecast
2019-01-02 11:09:31 -05:00

6 lines
307 B
Bash
Executable file

#!/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" > /tmp/weatherreport
pkill -RTMIN+5 i3blocks && notify-send "🌞 Weather forecast updated."