From 0cba8815c770258cb86a5289d8506167cff6690b Mon Sep 17 00:00:00 2001 From: drymer Date: Sat, 25 Feb 2017 13:49:33 +0000 Subject: [PATCH] weather --- i3/scripts/weather.example | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/i3/scripts/weather.example b/i3/scripts/weather.example index 03dcce7..bbbbc65 100755 --- a/i3/scripts/weather.example +++ b/i3/scripts/weather.example @@ -14,8 +14,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -CITY= -APPID= +CITY=barcelona +APPID="" OUTPUT=$(curl --silent http://api.openweathermap.org/data/2.5/weather\?APPID\=$APPID\&q\=$CITY\&units\=metric) @@ -24,18 +24,27 @@ WEATHER=$(echo $OUTPUT | jq -r ".weather[0].main") case $WEATHER in "Clear"*) WEATHER= - echo " $WEATHER $TEMP°C" + echo " $WEATHER $TEMP°C" ;; "Rain"*) - WEATHER= - echo " $WEATHER $TEMP°C" + WEATHER= + echo " $WEATHER $TEMP°C" ;; "Thunderstorm"*) WEATHER= - echo " $WEATHER $TEMP°C" + echo " $WEATHER $TEMP°C" ;; "Clouds"*) WEATHER= echo " $WEATHER $TEMP°C" ;; + "Drizzle"*) + WEATHER= + echo " $WEATHER $TEMP°C" + ;; + "Mist"*) + WEATHER= + echo " $WEATHER $TEMP°C" + ;; esac +#echo $WEATHER