From 1003ed4e9225697c65bf4877e74d069b3e645c89 Mon Sep 17 00:00:00 2001 From: mutlusun Date: Fri, 8 Mar 2019 08:20:27 +0100 Subject: [PATCH] update bat_freebsd --- widgets/bat_freebsd.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/widgets/bat_freebsd.lua b/widgets/bat_freebsd.lua index 22e4762..8139b4c 100644 --- a/widgets/bat_freebsd.lua +++ b/widgets/bat_freebsd.lua @@ -8,8 +8,8 @@ local string = { gmatch = string.gmatch, match = string.match, format = string.format - } + -- }}} local bat_freebsd = {} @@ -22,9 +22,9 @@ local function worker(format, warg) bat_info[key] = value end end - f:close() -- current state + -- see: https://github.com/freebsd/freebsd/blob/master/usr.sbin/acpi/acpiconf/acpiconf.c local state if bat_info["State"] == "high" then state = "↯" @@ -34,8 +34,12 @@ local function worker(format, warg) state = "+" elseif bat_info["State"] == "discharging" then state = "-" + elseif bat_info["State"] == "critical discharging" then + state = "!" + elseif bat_info["State"] == "critical" then + state = "!" else - state = "⌁" + state = "N/A" end -- battery capacity in percent