dwm/dwmstatus.sh
2021-03-31 12:46:34 +02:00

20 lines
732 B
Bash
Executable File

#!/bin/sh
while true; do
time=`date +"🕑 %a %d.%m. %H:%M"`
weatherdata=`cat weatherdump`
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}'`
weather="🌡 $temp°C 🌢 $humidity% ⚟ $wind""km/h ⬤ $sunrise-$sunset"
fi
xsetroot -name "$weather $time "
sleep 10
done