waybar: weather widget fix
This commit is contained in:
parent
0f2e5b7dcc
commit
cb21271da5
|
@ -1,9 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
|
||||||
1)i3-msg 'termite -e curl wttr.in';;
|
|
||||||
esac
|
|
||||||
|
|
||||||
CITY=$(curl -s ipinfo.io/city)
|
CITY=$(curl -s ipinfo.io/city)
|
||||||
APPID="fd68c0fe7951f5ab7e24a240eb0942b8"
|
APPID="fd68c0fe7951f5ab7e24a240eb0942b8"
|
||||||
|
|
||||||
|
@ -12,6 +8,11 @@ OUTPUT=$(http get http://api.openweathermap.org/data/2.5/weather\?APPID\=${APPID
|
||||||
# echo $APPID
|
# echo $APPID
|
||||||
# echo $OUTPUT
|
# echo $OUTPUT
|
||||||
|
|
||||||
|
if [ $? ]
|
||||||
|
then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
TEMP=$(echo $OUTPUT | jq -r ".main.temp")
|
TEMP=$(echo $OUTPUT | jq -r ".main.temp")
|
||||||
WEATHER=$(echo $OUTPUT | jq -r ".weather[0].main")
|
WEATHER=$(echo $OUTPUT | jq -r ".weather[0].main")
|
||||||
case $WEATHER in
|
case $WEATHER in
|
||||||
|
|
Reference in New Issue