From b9e9d87d6a6fbab92015676552db13d7fdde9c78 Mon Sep 17 00:00:00 2001 From: Yessiest Date: Wed, 31 Aug 2022 16:59:57 +0400 Subject: [PATCH] oh shuut here we go again --- widgets/battery.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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