voidrice/.scripts/cron/getforecast
Mohammad Rasim a251c9a080
use permanent location for weather report
this allows the weather to be cached and survive reboot(in case no
internet is available after reboot)
2019-02-07 21:21:24 +03:00

7 lines
321 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" > $HOME/.cache/larbs/weatherreport
pkill -RTMIN+5 i3blocks && notify-send "🌞 Weather forecast updated."