Fix i3weather blank location bug
This commit is contained in:
parent
b223dbbeb4
commit
9e27c7a4ac
1 changed files with 7 additions and 5 deletions
|
@ -1,14 +1,16 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
### This is only if your location isn't automatically detected, otherwise you can leave it blank.
|
||||||
|
location=""
|
||||||
|
|
||||||
[[ $BLOCK_BUTTON = "1" ]] && st -e w3m wttr.in
|
[[ $BLOCK_BUTTON = "1" ]] && st -e w3m wttr.in
|
||||||
|
|
||||||
ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` >/dev/null || exit
|
ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` >/dev/null || exit
|
||||||
|
|
||||||
### This is only if your location isn't automatically detected, otherwise you can leave it blank.
|
if [[ "$location" != "" ]]
|
||||||
loc=""
|
then
|
||||||
location=${loc// /+}
|
location="~${location// /+}"
|
||||||
|
fi
|
||||||
curl wttr.in/~$location > ~/.weatherreport
|
curl wttr.in/$location > ~/.weatherreport
|
||||||
|
|
||||||
echo -n ☔ $(cat ~/.weatherreport | sed -n 16p | sed -e 's/[^m]*m//g' | grep -o "[0-9]*%" | sort -n | sed -e '$!d')
|
echo -n ☔ $(cat ~/.weatherreport | sed -n 16p | sed -e 's/[^m]*m//g' | grep -o "[0-9]*%" | sort -n | sed -e '$!d')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue