This commit is contained in:
Tasonosenshi 2022-09-27 18:57:21 +09:00 committed by GitHub
commit b0f0f667a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,7 +6,9 @@ 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"):
if os.path.exists("/sys/class/power_supply/battery"):
dir_ = "/sys/class/power_supply/battery"
elif os.path.exists("/sys/class/power_supply/BAT0"):
dir_ = "/sys/class/power_supply/BAT0"
elif os.path.exists("/sys/class/power_supply/BAT1"):
dir_ = "/sys/class/power_supply/BAT1"