I have the following widget using vicious
in my rc.lua
:
-- Initialize widget Ethernet
ethwidget = wibox.widget.textbox()
-- Register widget
vicious.register(ethwidget, vicious.widgets.net, 'Eth0: <span color="#CC9933">down: ${eth0 down_kb} kB/s</span> <span color="#7F9F7F"> up: ${eth0 up_kb} kB/s</span><span color="#cccccc"> [ ${eth0 rx_gb} GB // ${eth0 tx_gb} GB ] | </span>', 2)
The thing is that I have a recent macbook pro, and if I don't have plugged the ethernet adapter, then I only see e.g. ${eth0 down_kb}
printed on my wibox. How could I add a conditional so that the widget is inserted only if the ethernet adapter is plugged?.