mirror of
https://github.com/LukeSmithxyz/voidrice.git
synced 2026-03-20 01:37:45 +01:00
Get the location based on the ip from freegeoip
If LOCATION is not set get the location based on the ip from freegeoip
This commit is contained in:
parent
f1814b3690
commit
a438e92778
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user