Merge branch 'master' of http://git.sysphere.org/vicious
This commit is contained in:
commit
30d0a7d260
7
init.lua
7
init.lua
|
@ -76,6 +76,8 @@ local function update(widget, reg, disablecache)
|
|||
widget:add_value(tonumber(data) and tonumber(data)/100)
|
||||
elseif widget.set_value ~= nil then
|
||||
widget:set_value(tonumber(data) and tonumber(data)/100)
|
||||
elseif widget.set_markup ~= nil then
|
||||
widget:set_markup(data)
|
||||
else
|
||||
widget.text = data
|
||||
end
|
||||
|
@ -118,6 +120,7 @@ local function regregister(reg)
|
|||
timers[reg.update] = {
|
||||
timer = capi.timer({ timeout = reg.timer })
|
||||
}
|
||||
|
||||
local tm = timers[reg.update].timer
|
||||
if tm.connect_signal then
|
||||
tm:connect_signal("timeout", reg.update)
|
||||
|
@ -125,10 +128,10 @@ local function regregister(reg)
|
|||
tm:add_signal("timeout", reg.update)
|
||||
end
|
||||
tm:start()
|
||||
end
|
||||
|
||||
-- Initial update
|
||||
reg.update()
|
||||
tm:emit_signal("timeout")
|
||||
end
|
||||
reg.running = true
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue