X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/233768f0963167af1d2621d10157cd64a87c904c..0a0a077b86208565075f7db79160feda8b02d745:/widget/weather.lua diff --git a/widget/weather.lua b/widget/weather.lua index f35ca68..c998ed9 100644 --- a/widget/weather.lua +++ b/widget/weather.lua @@ -13,6 +13,7 @@ local wibox = require("wibox") local math = math local os = os local string = string +local type = type local tonumber = tonumber -- OpenWeatherMap @@ -51,7 +52,7 @@ local function factory(args) weather.icon_path = icons_path .. "na.png" weather.icon = wibox.widget.imagebox(weather.icon_path) - function weather.show(t_out) + function weather.show(seconds) weather.hide() if followtag then @@ -63,12 +64,12 @@ local function factory(args) weather.forecast_update() end - weather.notification = naughty.notify({ + weather.notification = naughty.notify { + preset = notification_preset, text = weather.notification_text, icon = weather.icon_path, - timeout = t_out, - preset = notification_preset - }) + timeout = type(seconds == "number") and seconds or notification_preset.timeout + } end function weather.hide()