init: never pass string to awful.widget widgets
This commit is contained in:
parent
3ac4fcf150
commit
9a82d4113a
10
init.lua
10
init.lua
|
@ -115,9 +115,9 @@ local function update(widget, reg, disablecache)
|
||||||
end
|
end
|
||||||
|
|
||||||
if widget.add_value ~= nil then
|
if widget.add_value ~= nil then
|
||||||
widget:add_value(data and tonumber(data) / 100)
|
widget:add_value(tonumber(data) and tonumber(data)/100)
|
||||||
elseif widget.set_value ~= nil then
|
elseif widget.set_value ~= nil then
|
||||||
widget:set_value(data and tonumber(data) / 100)
|
widget:set_value(tonumber(data) and tonumber(data)/100)
|
||||||
else
|
else
|
||||||
widget.text = data
|
widget.text = data
|
||||||
end
|
end
|
||||||
|
@ -251,9 +251,9 @@ end
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
-- {{{ Force update of widgets
|
-- {{{ Force update of widgets
|
||||||
function force(widgets)
|
function force(wtable)
|
||||||
if type(widgets) == "table" then
|
if type(wtable) == "table" then
|
||||||
for _, w in pairs(widgets) do
|
for _, w in pairs(wtable) do
|
||||||
update(w, nil, true)
|
update(w, nil, true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue