lcpz/lain

Pulse and Battery widgets override doesn't work

RossComputerGuy opened this issue · 1 comments

AwesomeWM version: v4.3-894-gcc67a5b4
Lua version: 5.3.5

bat = lain.widget.bat{
        widget = {
                {
                        id = 'icon',
                        image = utils.lookup_icon('battery', 0),
                        resize = true,
                        widget = wibox.widget.imagebox
                },
                {
                        id = 'text',
                        widget = wibox.widget.textbox
                },
                layout = wibox.layout.fixed.horizontal
        },
        settings = function()
        end
}

snd = lain.widget.pulse{
        widget = {
                {
                        id = 'icon',
                        image = utils.lookup_icon('audio-card', 0),
                        resize = true,
                        widget = wibox.widget.imagebox
                },
                {
                        id = 'text',
                        widget = wibox.widget.textbox
                },
                layout = wibox.layout.fixed.horizontal
        },
        settings = function()
        end
}

I've also tried it where I set the widgets like this:

bat = lain.widget.bat{
	settings = function()
	end
}
bat.widget = {
	{
		id = 'icon',
		image = utils.lookup_icon('battery', 0),
		resize = true,
		widget = wibox.widget.imagebox
	},
	{
		id = 'text',
		widget = wibox.widget.textbox
	},
	layout = wibox.layout.fixed.horizontal
}

snd = lain.widget.pulse{
	settings = function()
	end
}
snd.widget = {
	{
		id = 'icon',
		image = utils.lookup_icon('audio-card', 0),
		resize = true,
		widget = wibox.widget.imagebox
	},
	{
		id = 'text',
		widget = wibox.widget.textbox
	},
	layout = wibox.layout.fixed.horizontal
}

However, widget becomes nil in the settings function.

lcpz commented

It doesn't work because that is not the intended way.

Both widgets have an internal textbox that you can modify within settings(), as you can read in the wiki.

But I understand the point of adding more customisation. Let me reply to your PR.