X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/6c40d0ffc7b154e12ce60a0ff52c5b84d142e805..321274e33237aefa896eabcf6fb0b2c439cd2bdb:/widgets/weather.lua diff --git a/widgets/weather.lua b/widgets/weather.lua index 7ff498a..3512f22 100644 --- a/widgets/weather.lua +++ b/widgets/weather.lua @@ -126,11 +126,13 @@ local function worker(args) if not err and weather_now and tonumber(weather_now["cod"]) == 200 then -- weather icon based on localtime - now = os.time() - (utc * 3600) + now = os.time() sunrise = tonumber(weather_now["sys"]["sunrise"]) sunset = tonumber(weather_now["sys"]["sunset"]) icon = weather_now["weather"][1]["icon"] + if sunrise <= (now-86400) then now = now - 86400 end + if sunrise <= now and now <= sunset then icon = string.gsub(icon, "n", "d") else