changed weather info from wttr.in to wetter.upb.de, since wttr.in was absolutely off and useless
This commit is contained in:
parent
cec41fd490
commit
a9a8c789a9
|
@ -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
|
||||
|
|
17
dwmstatus.sh
17
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user