Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in brightness-widget #379

Open
NicolasWebDev opened this issue Oct 2, 2022 · 1 comment
Open

Error in brightness-widget #379

NicolasWebDev opened this issue Oct 2, 2022 · 1 comment

Comments

@NicolasWebDev
Copy link

Using the default rc.lua, putting the widget in the wibar using require("awesome-wm-widgets.brightness-widget.brightness")(),, without any parameters, gives the following errors:

2022-10-02 11:43:36 E: awesome: Error during a protected call: /usr/share/awesome/lib/wibox/container/arcchart.lua:111: attempt to perform arithmetic on a function value (local 'v')
stack traceback:
        /usr/share/awesome/lib/wibox/container/arcchart.lua:111: in function 'wibox.container.arcchart.after_draw_children'
        [C]: in function 'xpcall'
        /usr/share/awesome/lib/gears/protected_call.lua:36: in function </usr/share/awesome/lib/gears/protected_call.lua:35>
        (...tail calls...)
        /usr/share/awesome/lib/wibox/hierarchy.lua:323: in local 'call'
        /usr/share/awesome/lib/wibox/hierarchy.lua:348: in function 'wibox.hierarchy.draw'
        /usr/share/awesome/lib/wibox/hierarchy.lua:345: in function 'wibox.hierarchy.draw'
        /usr/share/awesome/lib/wibox/hierarchy.lua:345: in function 'wibox.hierarchy.draw'
        /usr/share/awesome/lib/wibox/drawable.lua:160: in upvalue 'do_redraw'
        /usr/share/awesome/lib/wibox/drawable.lua:390: in function </usr/share/awesome/lib/wibox/drawable.lua:388>
        [C]: in function 'xpcall'
        /usr/share/awesome/lib/gears/protected_call.lua:36: in function </usr/share/awesome/lib/gears/protected_call.lua:35>
        (...tail calls...)
        /usr/share/awesome/lib/gears/timer.lua:231: in function </usr/share/awesome/lib/gears/timer.lua:229>

I haven't been able to debug it further, could it be a problem with timers?

The widget still seems to be working. I'm on commit 3bb3d56.

@NicolasWebDev
Copy link
Author

Replacing the two function definitions of set_value with update_value seem to make the problem go away, and everything still works.
I don't quite understand what is going on, though, because my lua knowledge is nonexistent.

Specifically changing

set_value = function(self, level)
    self:set_value(level)
end,

to

update_value = function(self, level)
    self:set_value(level)
end,

and

widget:set_value(brightness_level)

to

widget:update_value(brightness_level)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant