Mofiqul / awesome-shell

This is a collection of awesome wm configuration files
297 stars 18 forks source link

Startup failure with battery notification on desktop #10

Closed catthou closed 3 years ago

catthou commented 3 years ago

Hi, I get the error on starting awesome,

Oops, an error happened!
/home/user/.config/awesome/widgets/buttons/battery.lua:100: attempt to call field 'image' (a nil value)

The code in question is:

if stdout:match("Battery detected") then
...
else
    label:set_text("AC")
    icon.image(beautiful.icon_ac)      ##   <------
    icon:emit_signal("widget::redraw_needed")
    battery_panel_indicator:set_image(beautiful.icon_ac)
end

You probably never ran into this because you use a laptop with a battery. The appropriate line, I believe should be icon.image = beautiful.icon_ac.

Mofiqul commented 3 years ago

Thanks for report.