diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-10-20 21:15:19 +0200 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2009-10-20 21:15:19 +0200 |
commit | 40d78819774dd8b3963c642c2eb6b21948a64943 (patch) | |
tree | f7c107e5ba0bbc37a6cfe2a5af3a28cd59916560 /init.lua | |
parent | 25ce79e4e5c5bad03359ddaa3ca8b3ceb91f2c4f (diff) | |
download | vicious-legacy-40d78819774dd8b3963c642c2eb6b21948a64943.tar.xz |
Adapt to awful.widget.graph max_value of 1
Vicious will now divide values by 100 to match the default graph
max_value of 1. Graphs support changing this value, but progressbars
don't. We shouldn't use 100 for one and 1 for the other.
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -62,13 +62,13 @@ widgets = {} -- }}} -- {{{ Widget types -for w, i in pairs(_M) do +for i, w in pairs(_M) do -- Ensure we don't call ourselves - if i and i ~= _M and type(i) == "table" then + if w and w ~= _M and type(w) == "table" then -- Ignore the function table and helpers - if w ~= "widgets" and w ~= "helpers" then + if i ~= "widgets" and i ~= "helpers" then -- Place widgets in the namespace table - widgets[w] = i + widgets[i] = w end end end @@ -257,7 +257,7 @@ function update(widget, reg, disablecache) end if widget.add_value ~= nil then - widget:add_value(tonumber(data)) + widget:add_value(tonumber(data) / 100) elseif widget.set_value ~= nil then widget:set_value(tonumber(data) / 100) else |