diff --git a/bumblebee/modules/battery.py b/bumblebee/modules/battery.py index 9fa4c6e..581a3eb 100644 --- a/bumblebee/modules/battery.py +++ b/bumblebee/modules/battery.py @@ -19,7 +19,7 @@ class Module(bumblebee.engine.Module): super(Module, self).__init__(engine, config, bumblebee.output.Widget(full_text=self.capacity) ) - battery = self.parameter("device", "BAT0") + battery = self.parameter("device", "BAT1") self._path = "/sys/class/power_supply/{}".format(battery) self._capacity = 100 @@ -32,8 +32,11 @@ class Module(bumblebee.engine.Module): if not os.path.exists(self._path): self._ac = True - with open(self._path + "/capacity") as f: - self._capacity = int(f.read()) + try: + with open(self._path + "/capacity") as f: + self._capacity = int(f.read()) + except IOError: + self._capacity = 100 self._capacity = self._capacity if self._capacity < 100 else 100 def state(self, widget):