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 <serge@hallyn.com>
master
Serge E. Hallyn 4 years ago committed by Maarten van Gompel
parent 7d4b729b85
commit 16d77bcd86
  1. 3
      scripts/appscripts/sxmo_weather.sh

@ -80,9 +80,11 @@ printtables() {
printarow "Temp" "$ROWHOURS" "$TEMP" "$INDENT" printarow "Temp" "$ROWHOURS" "$TEMP" "$INDENT"
printarow "Rain" "$ROWHOURS" "$RAIN" "$INDENT" printarow "Rain" "$ROWHOURS" "$RAIN" "$INDENT"
printarow "Wind" "$ROWHOURS" "$WIND" "$INDENT" printarow "Wind" "$ROWHOURS" "$WIND" "$INDENT"
printarow "Dirn" "$ROWHOURS" "$DIRECTION" "$INDENT"
TIME="$(clearitemsfromrow "$ROWHOURS" "$TIME")" TIME="$(clearitemsfromrow "$ROWHOURS" "$TIME")"
TEMP="$(clearitemsfromrow "$ROWHOURS" "$TEMP")" TEMP="$(clearitemsfromrow "$ROWHOURS" "$TEMP")"
RAIN="$(clearitemsfromrow "$ROWHOURS" "$RAIN")" RAIN="$(clearitemsfromrow "$ROWHOURS" "$RAIN")"
DIRECTION="$(clearitemsfromrow "$ROWHOURS" "$DIRECTION")"
WIND="$(clearitemsfromrow "$ROWHOURS" "$WIND")" WIND="$(clearitemsfromrow "$ROWHOURS" "$WIND")"
echo "$TIME" | tr -d " " | tr -d '\n' | grep -Eq "^0" && echo "$TIME" | tr -d " " | tr -d '\n' | grep -Eq "^0" &&
@ -104,6 +106,7 @@ getweathertexttable() {
downloadweatherxml "$LAT" "$LON" 2>/dev/null downloadweatherxml "$LAT" "$LON" 2>/dev/null
TEMP="$(weatherdata "//temperature" "hourly")" TEMP="$(weatherdata "//temperature" "hourly")"
RAIN="$(weatherdata "//probability-of-precipitation" ".")" RAIN="$(weatherdata "//probability-of-precipitation" ".")"
DIRECTION="$(weatherdata "//direction" ".")"
WIND="$(weatherdata "//wind-speed" ".")" WIND="$(weatherdata "//wind-speed" ".")"
#LOCATION="$(weatherdata "//location/description" ".")" #LOCATION="$(weatherdata "//location/description" ".")"
TIME="$( TIME="$(

Loading…
Cancel
Save