20 lines
729 B
Bash
Executable File
20 lines
729 B
Bash
Executable File
#!/bin/sh
|
|
|
|
while true; do
|
|
time=`date +"🕑 %d.%m. %H:%M"`
|
|
|
|
weatherdata=`cat weatherdump`
|
|
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"
|
|
|
|
xsetroot -name "$weather $time "
|
|
sleep 10
|
|
done
|