diff --git a/dumpweather.sh b/dumpweather.sh index 717ea07..1649b36 100755 --- a/dumpweather.sh +++ b/dumpweather.sh @@ -1,6 +1,6 @@ #!/bin/sh while true; do - curl "wttr.in/Paderborn?m&format=j1" > weatherdump 2>/dev/null + curl "http://wetter.upb.de/handy.html" 2>/dev/null | iconv -f "iso8859-1" -t utf-8 | sed -e 's/<[^>]*>//g' > weatherdump sleep 600 done diff --git a/dwmstatus.sh b/dwmstatus.sh index d469dd8..fc31f61 100755 --- a/dwmstatus.sh +++ b/dwmstatus.sh @@ -1,21 +1,18 @@ #!/bin/sh while true; do - time=`date +"🕑 %d.%m. %H:%M"` + time=`date +"🕑 %a %d.%m. %H:%M"` weatherdata=`cat weatherdump` if [ -z "$weatherdata" ]; then weather="No weather data..." else - current=`echo "$weatherdata" | jq -r '.current_condition | .[0]'` - temp=`echo "$current" | jq -r '.temp_C'` - weatherDesc=`echo "$current" | jq -r '.weatherDesc | .[0].value'` - wind=`echo "$current" | jq -r '.windspeedKmph'` - astronomy=`echo "$weatherdata" | jq -r '.weather | .[0] .astronomy | .[0]'` - moonphase=`echo "$astronomy" | jq -r '.moon_phase'` - sunrise=`echo "$astronomy" | jq -r '.sunrise'` - sunset=`echo "$astronomy" | jq -r '.sunset'` - weather="🌡 $temp°C $weatherDesc $wind""km/h Daylight $sunrise-$sunset, Moon $moonphase" + temp=`echo "$weatherdata" | grep "Temp:" | awk '{print $2}'` + humidity=`echo "$weatherdata" | grep "Luftfeuchte:" | awk '{print $2}'` + wind=`echo "$weatherdata" | grep "Windstärke:" | awk '{print $(NF-1)}'` + sunrise=`echo "$weatherdata" | grep "Sonnenaufgang:" | awk '{print $2}'` + sunset=`echo "$weatherdata" | grep "Sonnenuntergang:" | awk '{print $2}'` + weather="🌡 $temp°C ☔ $humidity% ↗ $wind""km/h ☀ $sunrise-$sunset" fi xsetroot -name "$weather $time " sleep 10