From 6d337abc8e7a78a2f2ca97b3ef8f5e26c78ad0e4 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 4 Feb 2021 15:53:08 +0700 Subject: [PATCH] acpi for some reason can return multiple batteries even though there is only one --- i3block_py/energy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i3block_py/energy.py b/i3block_py/energy.py index 6d00839..28462d6 100755 --- a/i3block_py/energy.py +++ b/i3block_py/energy.py @@ -9,7 +9,7 @@ LOG_FILE_PATH = "/tmp/battery_status.log" def get_acpi(): """ get acpi data as a sting """ acpi_raw = subprocess.run(["acpi"], capture_output=True, check=False) - acpi_string = acpi_raw.stdout.decode().strip() + acpi_string = acpi_raw.stdout.decode().strip().split('\n')[0] return acpi_string