mirror of
https://github.com/b-ryan/powerline-shell.git
synced 2026-09-10 07:26:28 -04:00
Merge 9f210a0301 into 4b19aa47f1
This commit is contained in:
commit
6820c53564
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue