X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/1342ae481bc727c45a7e773ec8f815177a9299f5..fd2e616097ac4cb072957b3f0b8134ac1970f831:/widget/cal.lua?ds=inline diff --git a/widget/cal.lua b/widget/cal.lua index 47e91a9..2482ccb 100644 --- a/widget/cal.lua +++ b/widget/cal.lua @@ -14,11 +14,13 @@ local os = os local pairs = pairs local string = string local tconcat = table.concat +local type = type local tonumber = tonumber local tostring = tostring -- Calendar notification -- lain.widget.cal + local function factory(args) args = args or {} local cal = { @@ -79,7 +81,7 @@ local function factory(args) cal.notification = nil end - function cal.show(timeout, month, year, scr) + function cal.show(seconds, month, year, scr) cal.notification_preset.text = tconcat(cal.build(month, year)) if cal.three then @@ -97,7 +99,7 @@ local function factory(args) preset = cal.notification_preset, screen = cal.followtag and awful.screen.focused() or scr or 1, icon = cal.icon, - timeout = timeout or cal.notification_preset.timeout or 5 + timeout = type(seconds) == "number" and seconds or cal.notification_preset.timeout or 5 } end