sda read_mb doesn't work. I must use vicious.register(iowidget,
vicious.widgets.dio, "${read_mb}", 2, "sda"). Is this normal?
"Jörg Thalheim" <[email protected]> wrote:
You have not to rewrite it.
I already did this in the past, to display more than one partition in a widget:
http://git.sysphere.org/vicious/commit/?id=c2f7fbcf2358cf83b103954ec0dc579aea39e3cb
I advice you to use a format function as described in the README
iowidget = widget({ type = "textbox" })
vicious.register(iowidget, vicious.widgets.dio,
function (widget, args)
local text = ""
-- simply check whether the args table contains the disk/partition
if args["{sda total_s}"] =~ nil then
-- and then add it:
text = string.format("%ssda %skb/%skb ", text, args["{sda
write_kb"], args["{sda read_kb}"])
end
-- look the same way for some more disk. Alternatively use a loop.
return text -- The value returned by the function is assigned to
iowidget.
end)
I use it in a similar way here. I my own config:
https://github.com/Mic92/awesome-dotfiles/blob/master/rc.lua#L372
2011/9/8 Daniel Martí <[email protected]>:
> I hadn't thought about re-writing dio. I'll try it on my own first, and if I
> need any assistance I'll come back.
>
> Thanks!
>
> "Jörg Thalheim" <[email protected]> wrote:
>>
>> My first rewrite of dio included the feature, to sum up the disk i/o
>> of every avaible disk to total numbers. Is this what you want? (I
>> still have the code avaible)
>> Or do you want to see every disk separately? In this case, you could
>> use a format function to guess the new disks.
>>
>> Choose between this options and we can find a solution.
>>
>> 2011/9/6 Daniel Martí <[email protected]>:
>> > Hey guys!
>> >
>> > I'm very happy with the vicious scripts, especially the dio one (disk
>> > input/output). I configured the udev rules to automount usb devices and
>> > show
>> > up a notification via naughty, and it works.
>> > Now, i'd like the same script (that uses awesome-client and naughty,
>> > called
>> > by udevd) to create and show a dio widget alongside the constant
>> > /dev/sda
>> > one, showing up I/O stats for the newly
>> mounted device.
>> >
>> > I have two ideas, but both got me stuck.
>> > -- use one "iowidget" holding sda i/o at boot and add the new device's
>> > stats
>> > at the end of it. Is that possible?
>> > -- create a brand new widget for every newly mounted device. This seems
>> > easier to set up, but my experience with awesome is very small
>> > (~3months)
>> > and i don't know how to make the new widget show up in a wibox that has
>> > already been assigned some widgets.
>> >
>> > Thank you so much for reading and for your help.
>>
>>
>>
>> --
>> Gruß Jörg
>
--
Gruß Jörg