X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/4cd75de2ed52f4bc39ad52eee7d5155c6036ce0e..ea784d4c844449e8184e3f2e62cd829d3a543734:/widgets/yawn/init.lua?ds=inline diff --git a/widgets/yawn/init.lua b/widgets/yawn/init.lua index 4d14966..2306fed 100644 --- a/widgets/yawn/init.lua +++ b/widgets/yawn/init.lua @@ -43,7 +43,7 @@ local city_id = nil local sky = nil local settings = function() end -notification_preset = {} +yawn_notification_preset = {} local function fetch_weather() local url = api_url .. units_set .. city_id @@ -56,6 +56,7 @@ local function fetch_weather() -- widgets won't display if text == "" or text:match("City not found") then + yawn.icon:set_image(icon_path .. "na.png") if text == "" then weather_data = "Service not available at the moment." yawn.widget:set_text("N/A") @@ -130,7 +131,7 @@ local function fetch_weather() yawn.icon:set_image(sky) widget = yawn.widget - forecast = weather_data:match(": %S+.-,"):gsub(": ", ""):gsub(",", "\n") + forecast = weather_data:match(": %S.-,"):gsub(": ", ""):gsub(",", "") units = units:gsub(" ", "") settings() @@ -152,7 +153,7 @@ function yawn.show(t_out) yawn.hide() notification = naughty.notify({ - preset = notification_preset, + preset = yawn_notification_preset, text = weather_data, icon = sky, timeout = t_out