Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Ive got pretty standard vicious net widget for the eth0, yet this is my laptop and I move a lot, sometimes I use wlan0, sometimes ppp0. Is there a way in vicious to dynamically choose the active iface?

netwidget = widget({ type = "textbox" })
-- Register widget
vicious.register(netwidget, vicious.widgets.net, '<span color="'
.. beautiful.fg_netdn_widget ..'">${eth0 down_kb}</span> <span color="'
.. beautiful.fg_netup_widget ..'">${eth0 up_kb}</span>', 3)
share|improve this question
add comment

1 Answer

Make use of the ${ carrier} variable to determine which interface is up between eth0, wlan0 or ppp0, then return data of that interface. Do all of this in a format function.

Everything you need is in the README.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.