This commit is contained in:
Florian Feldmann 2022-09-27 18:57:24 +09:00 committed by GitHub
commit 6820c53564
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,10 +6,10 @@ class Segment(BasicSegment):
def add_to_powerline(self):
# See discussion in https://github.com/banga/powerline-shell/pull/204
# regarding the directory where battery info is saved
if os.path.exists("/sys/class/power_supply/BAT0"):
dir_ = "/sys/class/power_supply/BAT0"
elif os.path.exists("/sys/class/power_supply/BAT1"):
if os.path.exists("/sys/class/power_supply/BAT1"):
dir_ = "/sys/class/power_supply/BAT1"
elif os.path.exists("/sys/class/power_supply/BAT0"):
dir_ = "/sys/class/power_supply/BAT0"
else:
warn("battery directory could not be found")
return