diff --git a/.local/bin/statusbar/sb-forecast b/.local/bin/statusbar/sb-forecast index 7b8416ec..d7e279aa 100755 --- a/.local/bin/statusbar/sb-forecast +++ b/.local/bin/statusbar/sb-forecast @@ -7,6 +7,7 @@ # You could set up a shell alias to view the full file in a pager in the # terminal if desired. This function will only be run once a day when needed. weatherreport="${XDG_DATA_HOME:-$HOME/.local/share}/weatherreport" +[ -z "$LOCATION" ] && LOCATION="$(curl -s https://freegeoip.app/json/ | jq .city)" getforecast() { curl -sf "wttr.in/$LOCATION" > "$weatherreport" || exit 1 ;} # Some very particular and terse stream manipulation. We get the maximum