widget.bat: fixed ac variable; improved autodetection; #397
This commit is contained in:
parent
f42fe32d99
commit
907529920f
1 changed files with 2 additions and 2 deletions
|
@ -41,7 +41,7 @@ local function factory(args)
|
||||||
if bstr then
|
if bstr then
|
||||||
bat.batteries[#bat.batteries + 1] = bstr
|
bat.batteries[#bat.batteries + 1] = bstr
|
||||||
else
|
else
|
||||||
bat.ac = string.match(line, "AC%w+") or "AC0"
|
bat.ac = string.match(line, "A%w+") or "AC0"
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
@ -141,7 +141,7 @@ local function factory(args)
|
||||||
bat_now.status = status
|
bat_now.status = status
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
bat_now.ac_status = tonumber(helpers.first_line(string.format("%s%s/online", pspath, ac))) or "N/A"
|
bat_now.ac_status = tonumber(helpers.first_line(string.format("%s%s/online", pspath, bat.ac))) or "N/A"
|
||||||
|
|
||||||
if bat_now.status ~= "N/A" then
|
if bat_now.status ~= "N/A" then
|
||||||
if bat_now.status ~= "Full" and sum_rate_power == 0 and bat_now.ac_status == 1 then
|
if bat_now.status ~= "Full" and sum_rate_power == 0 and bat_now.ac_status == 1 then
|
||||||
|
|
Loading…
Add table
Reference in a new issue