dwmbar/modules/weather

17 lines
277 B
Text
Raw Normal View History

2020-11-01 12:00:56 +00:00
#!/bin/bash
# Deps:
# curl
2019-10-21 18:42:40 +00:00
get_weather()
{
2023-03-01 08:37:39 +00:00
CITY=Chandigarh
curl -s v2.wttr.in/$CITY | grep -e "Weather" | sed -n 2p | sed s/Weather://g | sed 's/,//g' | sed 's/+//g' | sed 's/°C.*/°C/' | sed 's/.*m//'
}
2020-11-01 11:59:22 +00:00
if [ $(( 10#$(date '+%S') % 30 )) -eq 0 ]; then
get_weather
fi