X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/6cc550655fad64e784ff87916f3ef439ebaf4c4a..880e0188ba8205c90db2c363893378dc0f341d77:/widgets/yawn/init.lua diff --git a/widgets/yawn/init.lua b/widgets/yawn/init.lua index 36cdf54..86a2d0f 100644 --- a/widgets/yawn/init.lua +++ b/widgets/yawn/init.lua @@ -1,3 +1,4 @@ + --[[ Licensed under GNU General Public License v2 @@ -57,12 +58,12 @@ local function fetch_weather() 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") + yawn.widget:set_text(" N/A ") else weather_data = "City not found!\n" .. "Are you sure " .. city_id .. " is your Yahoo city ID?" - yawn.widget:set_text(" ?") + yawn.widget:set_text(" ? ") end return end @@ -74,7 +75,7 @@ local function fetch_weather() -- may still happens in case of bad connectivity if weather_data == "" then yawn.icon:set_image(icon_path .. "na.png") - yawn.widget:set_text(" ?") + yawn.widget:set_text(" ? ") return end @@ -134,7 +135,8 @@ local function fetch_weather() yawn.icon:set_image(sky) widget = yawn.widget - forecast = weather_data:match(": %S.-,"):gsub(": ", ""):gsub(",", "") + _data = weather_data:match(": %S.-,") or weather_data + forecast = _data:gsub(": ", ""):gsub(",", "") units = units:gsub(" ", "") settings()