Merge branch 'master' of http://git.sysphere.org/vicious
This commit is contained in:
commit
e2cdb97e2f
23
README
23
README
|
@ -480,6 +480,29 @@ Example
|
|||
- forces a fixed width of 50px to the uptime widget, and aligns its
|
||||
text to the right
|
||||
|
||||
Another use case are stacked graphs (aka multigraphs) which Vicious
|
||||
does not handle on its own at the moment, as it's hard to pass on
|
||||
color index arguments elegantly. But they are not unusable, far from
|
||||
it.
|
||||
|
||||
Example
|
||||
ctext = widget({ type = "textbox"})
|
||||
cgraph = awful.widget.graph()
|
||||
cgraph:set_width(100):set_height(20)
|
||||
cgraph:set_stack(true):set_max_value(100)
|
||||
cgraph:set_background_color("#494B4F")
|
||||
cgraph:set_stack_colors({ "#FF5656", "#88A175", "#AECF96" })
|
||||
vicious.register(ctext, vicious.widgets.cpu,
|
||||
function (widget, args)
|
||||
cgraph:add_value(args[2], 1) -- Core 1, color 1
|
||||
cgraph:add_value(args[3], 2) -- Core 2, color 2
|
||||
cgraph:add_value(args[4], 3) -- Core 3, color 3
|
||||
end, 3)
|
||||
|
||||
- enables graph stacking/multigraph and plots usage of all three CPU
|
||||
cores on a single graph, the textbox "ctext" is just an empty
|
||||
placeholder, graph is updated every 3 seconds
|
||||
|
||||
|
||||
Other
|
||||
-----
|
||||
|
|
|
@ -65,7 +65,7 @@ local function worker(format, warg)
|
|||
|
||||
-- Calculate remaining (charging or discharging) time
|
||||
local time = "N/A"
|
||||
if rate ~= nil then
|
||||
if tonumber(rate) then
|
||||
if state == "+" then
|
||||
timeleft = (tonumber(capacity) - tonumber(remaining)) / tonumber(rate)
|
||||
elseif state == "-" then
|
||||
|
|
Loading…
Reference in New Issue