Merge pull request #433 from martindoublem/master
[battery_all] Fixed the battery path and used os to solve for the corrects paths
This commit is contained in:
commit
d7c6b8dde6
1 changed files with 4 additions and 5 deletions
|
@ -25,10 +25,9 @@ except ImportError:
|
||||||
class Module(bumblebee.engine.Module):
|
class Module(bumblebee.engine.Module):
|
||||||
def __init__(self, engine, config):
|
def __init__(self, engine, config):
|
||||||
self._batteries = []
|
self._batteries = []
|
||||||
# TODO: list all batteries
|
for battery in os.listdir('/sys/class/power_supply/'):
|
||||||
self._batteries.append("/sys/class/power_supply/BAT0")
|
if not any(i in battery for i in ['AC', 'hidpp']):
|
||||||
self._batteries.append("/sys/class/power_supply/BAT1")
|
self._batteries.append("/sys/class/power_supply/" + battery)
|
||||||
self._batteries.append("/sys/class/power_supply/battery")
|
|
||||||
|
|
||||||
super(Module, self).__init__(engine, config, bumblebee.output.Widget(full_text=self.capacity))
|
super(Module, self).__init__(engine, config, bumblebee.output.Widget(full_text=self.capacity))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue