diff --git a/widget/bat.lua b/widget/bat.lua index 3cb801c..3310069 100644 --- a/widget/bat.lua +++ b/widget/bat.lua @@ -136,7 +136,7 @@ local function factory(args) -- "Full", "Unknown" or "Charging". When the laptop is not plugged in, -- one or more of the batteries may be full, but only one battery -- discharging suffices to set global status to "Discharging". - bat_now.status = bat_now.n_status[1] + bat_now.status = bat_now.n_status[1] or "N/A" for _,status in ipairs(bat_now.n_status) do if status == "Discharging" or status == "Charging" then bat_now.status = status