You are not logged in.

#1 2012-01-02 04:18:29

JackH79
Member
From: Australia
Registered: 2009-06-18
Posts: 663
Website

[SOLVEDish] awesome: can't hide widgets with "widget.visible = false"

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 smile

Last edited by JackH79 (2012-01-06 04:40:52)

Offline

#2 2012-01-02 22:59:56

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: [SOLVEDish] awesome: can't hide widgets with "widget.visible = false"

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

#3 2012-01-03 01:09:47

JackH79
Member
From: Australia
Registered: 2009-06-18
Posts: 663
Website

Re: [SOLVEDish] awesome: can't hide widgets with "widget.visible = false"

Thanks anrxc. I'll do that.

Offline

#4 2012-01-06 04:40:06

JackH79
Member
From: Australia
Registered: 2009-06-18
Posts: 663
Website

Re: [SOLVEDish] awesome: can't hide widgets with "widget.visible = false"

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

Board footer

Powered by FluxBB