You are not logged in.

#1 2008-08-27 20:39:01

pablored
Member
Registered: 2004-06-26
Posts: 25

Wicked Widget Format / Padding Output Problem

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 hmm

Last edited by pablored (2008-08-27 20:55:27)

Offline

#2 2008-08-28 10:25:03

GGLucas
Member
Registered: 2008-03-13
Posts: 113

Re: Wicked Widget Format / Padding Output Problem

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

#3 2008-08-28 11:40:35

pablored
Member
Registered: 2004-06-26
Posts: 25

Re: Wicked Widget Format / Padding Output Problem

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

#4 2008-08-28 17:11:18

GGLucas
Member
Registered: 2008-03-13
Posts: 113

Re: Wicked Widget Format / Padding Output Problem

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

#5 2008-11-20 15:26:18

gajo
Member
Registered: 2008-04-01
Posts: 93
Website

Re: Wicked Widget Format / Padding Output Problem

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

Board footer

Powered by FluxBB