From 9f210a0301bfca030a9aaf2e7252b8dc1474af74 Mon Sep 17 00:00:00 2001 From: Florian Feldmann Date: Sun, 2 Feb 2020 03:24:03 +0100 Subject: [PATCH] Picking the external battery over the internal (At least on thinkpads) --- powerline_shell/segments/battery.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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