diff --git a/powerline_shell/segments/battery.py b/powerline_shell/segments/battery.py index 24c5f1f5..51bc7acc 100644 --- a/powerline_shell/segments/battery.py +++ b/powerline_shell/segments/battery.py @@ -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