You are not logged in.
Hi forum, it's been a while.
I'm hoping this is quick and obvious to someone. Basically I'm looking to pad the output of the standard network monitor Wicked widget, and maybe some of the others, for the new Awesome 3 GIT. It is all working fine, just i'd like to stop the numbers moving around my status bar. As a temp fix to stop everything moving i've set the width of the network widget, but is their some Lua formatting that can go in the output string and sort this properly?
Cheers
pablored
Edit.. changed title from Help to Problem, as it could be misread
Last edited by pablored (2008-08-27 20:55:27)
Offline
I've added a padding argument to wicked.register just now, update your wicked to the latest git HEAD and you can use it, try this to padd the network widget:
wicked.register(mynetwidget, wicked.widgets.net, "${eth0 down}", nil, nil, 3)
(Of course replace the format string with whatever you had before, and the first nil with a number if you had a different timer than every second.
Offline
Wow... tries to avoid words such as amazing and awesome... that's great, I will try this when I get home. I note the WIKI is updated too.
I was part way through breaking everything down into individual widgets that had their width set, but that was pretty time consuming and not very elegant. I had thought there might be something I was missing that I could wrap around the dollar variable, format(${eth0 down},'000') etc, but your way is simpler.
My new user understanding:
wicked.register(widget-name, function-name, output-string, interval-in-seconds, properties-name ,{padding-item-1, ... padding-item-n})
I look forward to playing with it later, thanks for your help.
Offline
Yup, that's correct, the net widget doesn't support different padding for different items, though, all values are padded equally, so putting a table there will break it.
Widgets that have numbered arguments ($1,$2,etc), like the cpu, mem and swap widgets, do support different paddings.
Offline
hmm, not sure why it isn't working for me, i tried all sorts of numbers, my current attempt being
netwidget = widget({ type = 'textbox', name = 'netwidget', align = "right"})
wicked.register(netwidget, wicked.widgets.net, ' Net: <span color="'..beautiful.fg_focus..'">${eth0 down_kb} / ${eth0 up_kb} </span> ', 3, nil, 20)
it seems as if padding has no effect, tried it with larger and smaller numbers as well
Offline