From 9a82d4113a8271b7dfc7506f2b07379e3ede89a8 Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Sat, 13 Mar 2010 22:46:45 +0100 Subject: init: never pass string to awful.widget widgets --- init.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index bf54918..73d382d 100644 --- a/init.lua +++ b/init.lua @@ -115,9 +115,9 @@ local function update(widget, reg, disablecache) end 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 - widget:set_value(data and tonumber(data) / 100) + widget:set_value(tonumber(data) and tonumber(data)/100) else widget.text = data end @@ -251,9 +251,9 @@ end -- }}} -- {{{ Force update of widgets -function force(widgets) - if type(widgets) == "table" then - for _, w in pairs(widgets) do +function force(wtable) + if type(wtable) == "table" then + for _, w in pairs(wtable) do update(w, nil, true) end end -- cgit v1.2.3