X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/8468b88f4a6fd21042253d463c500f6da6f6d2fc..fdf8132242195669ee6eeff5e4c91da1c372ee47:/widgets/weather.lua?ds=inline diff --git a/widgets/weather.lua b/widgets/weather.lua index c69d02b..7673284 100644 --- a/widgets/weather.lua +++ b/widgets/weather.lua @@ -75,7 +75,7 @@ local function worker(args) f:close() weather_now, pos, err = json.decode(j, 1, nil) - if not err and tonumber(weather_now["cod"]) == 200 then + if not err and weather_now ~= nil and tonumber(weather_now["cod"]) == 200 then weather.notification_text = '' for i = 1, weather_now["cnt"] do local f = assert(io.popen(string.format(date_cmd, weather_now["list"][i]["dt"]))) @@ -116,6 +116,8 @@ local function worker(args) end) end + weather.attach(weather.widget) + newtimer("weather", timeout, weather.update) newtimer("weather_forecast", timeout, weather.forecast_update)