More concise default timer settings.

This commit is contained in:
Beniamin Kalinowski 2018-01-20 14:05:21 +09:00
parent eb0c07e3fc
commit 1f6359e306
1 changed files with 2 additions and 8 deletions

View File

@ -158,26 +158,20 @@ end
-- {{{ Global functions
-- {{{ Register a widget
function vicious.register(widget, wtype, format, timer, warg)
local widget = widget
local reg = {
-- Set properties
wtype = wtype,
lock = false,
format = format,
timer = timer,
timer = timer or 2,
warg = warg,
widget = widget,
}
-- Set functions
reg.update = function ()
function reg.update()
update(widget, reg)
end
-- Default to 2s timer
if reg.timer == nil then
reg.timer = 2
end
-- Register a reg object
regregister(reg)