From 16d77bcd86253e6e711a9f0e272e0eadcddbbb54 Mon Sep 17 00:00:00 2001 From: "Serge E. Hallyn" Date: Sun, 15 Nov 2020 08:49:24 -0600 Subject: [PATCH] sxmo_weather: add wind direction It's important for me to see wind direction in addition to speed. I understand most people probably don't care, so we should probably show this only if xinit sets WEATHER_WIND_DIR=1? But we can bikeshed that later, for now here's what I'm using on my phone right now. Signed-off-by: Serge Hallyn --- scripts/appscripts/sxmo_weather.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/appscripts/sxmo_weather.sh b/scripts/appscripts/sxmo_weather.sh index faaf3c3..00acd5e 100755 --- a/scripts/appscripts/sxmo_weather.sh +++ b/scripts/appscripts/sxmo_weather.sh @@ -80,9 +80,11 @@ printtables() { printarow "Temp" "$ROWHOURS" "$TEMP" "$INDENT" printarow "Rain" "$ROWHOURS" "$RAIN" "$INDENT" printarow "Wind" "$ROWHOURS" "$WIND" "$INDENT" + printarow "Dirn" "$ROWHOURS" "$DIRECTION" "$INDENT" TIME="$(clearitemsfromrow "$ROWHOURS" "$TIME")" TEMP="$(clearitemsfromrow "$ROWHOURS" "$TEMP")" RAIN="$(clearitemsfromrow "$ROWHOURS" "$RAIN")" + DIRECTION="$(clearitemsfromrow "$ROWHOURS" "$DIRECTION")" WIND="$(clearitemsfromrow "$ROWHOURS" "$WIND")" echo "$TIME" | tr -d " " | tr -d '\n' | grep -Eq "^0" && @@ -104,6 +106,7 @@ getweathertexttable() { downloadweatherxml "$LAT" "$LON" 2>/dev/null TEMP="$(weatherdata "//temperature" "hourly")" RAIN="$(weatherdata "//probability-of-precipitation" ".")" + DIRECTION="$(weatherdata "//direction" ".")" WIND="$(weatherdata "//wind-speed" ".")" #LOCATION="$(weatherdata "//location/description" ".")" TIME="$(