forked from ashpie/simple-awesome
Battery widget: don't show usb device battery
This commit is contained in:
parent
a29cf9e2b6
commit
a609640435
@ -150,7 +150,7 @@ function getBatteryCapacity()
|
|||||||
local charge = 0
|
local charge = 0
|
||||||
local capacity = 0
|
local capacity = 0
|
||||||
for b in getBatteries() do
|
for b in getBatteries() do
|
||||||
if readCommand("cat /sys/class/power_supply/" .. b .. "/type"):match("Battery") then
|
if b:sub(1,3) ~= 'hid' and readCommand("cat /sys/class/power_supply/" .. b .. "/type"):match("Battery") then
|
||||||
charge = charge + readCommand("cat /sys/class/power_supply/" .. b .. "/energy_now")
|
charge = charge + readCommand("cat /sys/class/power_supply/" .. b .. "/energy_now")
|
||||||
capacity = capacity + readCommand("cat /sys/class/power_supply/" .. b .. "/energy_full")
|
capacity = capacity + readCommand("cat /sys/class/power_supply/" .. b .. "/energy_full")
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user