You are not logged in.
Recently installed 'awesome-git 20111128-1'.
Can't get my vicious network widgets to hide when I'm not connected.
netupwidget = wibox.widget.textbox()
vicious.cache(vicious.widgets.net)
vicious.register(netupwidget, vicious.widgets.net, "" .. colblk .. "up " .. coldef .. colbblk .. "${eth0 up_kb} " .. coldef .. "")
netdownwidget = wibox.widget.textbox()
vicious.register(netdownwidget, vicious.widgets.net, "" .. colblk .. "down " ..coldef .. colbblk .. "${eth0 down_kb} " .. coldef .. "")
netwidget = wibox.widget.textbox()
vicious.register(netwidget, vicious.widgets.net,
function (widget, args)
function ip_addr()
local ip = io.popen("ip addr show eth0 | grep 'inet '")
local addr = ip:read("*a")
ip:close()
addr = string.match(addr, "%d+.%d+.%d+.%d+")
return addr
end
if ip_addr() == nil then
netdownwidget.visible = false
netupwidget.visible = false
return ""
else
netdownwidget.visible = true
netupwidget.visible = true
return "" .. colblk .. "eth0 " .. coldef .. colbblk .. ip_addr() .. coldef .. " "
end
end, refresh_delay, "eth0")
and
local right_layout = wibox.layout.fixed.horizontal()
if s == 1 then right_layout:add(wibox.widget.systray()) end
right_layout:add(netupwidget)
right_layout:add(netdownwidget)
right_layout:add(netwidget)
Maybe I just missed an announcement, but I couldn't find anything on the mailing list.
Thanks for any pointers
Last edited by JackH79 (2012-01-06 04:40:52)
Offline
The textbox is now an awful module, who knows if "visible" is implemented. Ask on the development mailing list.
You need to install an RTFM interface.
Offline
Thanks anrxc. I'll do that.
Offline
So, just to finish up this thread, apparently the "visible = false" feature does no longer work.
Uli Schlachter on the awesome devel mailing list offered a hack to circumvent the problem (http://www.mail-archive.com/awesome-dev … 06713.html), in case someone is interested.
Offline