dwm/dwmstatus.sh

20 lines
732 B
Bash
Raw Permalink Normal View History

2021-03-14 15:41:00 +01:00
#!/bin/sh
while true; do
time=`date +"🕑 %a %d.%m. %H:%M"`
2021-03-14 15:41:00 +01:00
weatherdata=`cat weatherdump`
2021-03-15 21:38:14 +01:00
if [ -z "$weatherdata" ]; then
weather="No weather data..."
else
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}'`
2021-03-31 12:46:34 +02:00
weather="🌡 $temp°C 🌢 $humidity% ⚟ $wind""km/h ⬤ $sunrise-$sunset"
2021-03-15 21:38:14 +01:00
fi
2021-03-14 15:41:00 +01:00
xsetroot -name "$weather $time "
sleep 10
done