diff --git a/widgets/battery.lua b/widgets/battery.lua index 5bfc0aa..68cf843 100644 --- a/widgets/battery.lua +++ b/widgets/battery.lua @@ -223,7 +223,14 @@ return function(args) }) -- }}} -- We don't need this widget if we don't have anything to show - if #widget_map == 0 then + local function count(t) + local count = 0 + for k,v in pairs(t) do + count = count + 1 + end + return count + end + if count(widget_map) == 0 then backlight_update:stop() power_update:stop() return