Merge pull request #179 from neh/master

Remove stray backslashes from upower command
This commit is contained in:
Piotr Miller
2023-02-10 02:31:37 +01:00
committed by GitHub

View File

@@ -526,7 +526,7 @@ def get_battery():
if not success and nwg_panel.common.commands["upower"]:
lines = subprocess.check_output(
"upower -i $(upower -e | grep devices/battery) | grep --color=never -E 'state|to\ full|to\ empty|percentage'",
"upower -i $(upower -e | grep devices/battery) | grep --color=never -E 'state|to[[:space:]]full|to[[:space:]]empty|percentage'",
shell=True).decode("utf-8").strip().splitlines()
for line in lines:
if "state:" in line: