Guess user location when running weather ""
Omitting colon makes bash substitute default location only when parameter is absent. Therefore empty city name propagates to wttr.in and allows it to guess.
This commit is contained in:
parent
d3b28cbf09
commit
dce65ed181
1 changed files with 1 additions and 1 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
wttr()
|
wttr()
|
||||||
{
|
{
|
||||||
# change Paris to your default location
|
# change Paris to your default location
|
||||||
local request="wttr.in/${1:-Paris}"
|
local request="wttr.in/${1-Paris}"
|
||||||
[ "$COLUMNS" -lt 125 ] && request+='?n'
|
[ "$COLUMNS" -lt 125 ] && request+='?n'
|
||||||
curl -H "Accept-Language: ${LANG%_*}" --compressed "$request"
|
curl -H "Accept-Language: ${LANG%_*}" --compressed "$request"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue