mirror of https://github.com/lcpz/lain.git
Fix ac detection for bat widget.
Multiple power sources may exist under /sys/class/power_supply/. Durring autodetection (get_batteries), will case the detected ac to be reset to 'AC0' if a power source not starting with BAT or AC. This change skips updating the name of the ac device if the devices does not start with 'AC'
This commit is contained in:
parent
b38c6d67e9
commit
15bba30180
|
@ -43,7 +43,7 @@ local function factory(args)
|
|||
if bstr then
|
||||
batteries[#batteries + 1] = bstr
|
||||
else
|
||||
ac = string.match(line, "A%w+") or "AC0"
|
||||
ac = string.match(line, "A%w+") or ac
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue