From 13e03331f807cdbe2dec5ca1edee99b866a9c2e7 Mon Sep 17 00:00:00 2001 From: Ace Date: Sun, 23 Jun 2024 21:08:01 +0200 Subject: [PATCH] fix some minor bugs --- inkycal/utils/pisugar.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/inkycal/utils/pisugar.py b/inkycal/utils/pisugar.py index 7f00cee..5c4bf8c 100644 --- a/inkycal/utils/pisugar.py +++ b/inkycal/utils/pisugar.py @@ -24,11 +24,12 @@ class PiSugar: return None cmd = self.command_template.replace("command", command) try: - result = subprocess.run(cmd, text=True, capture_output=True) + result = subprocess.run(cmd, shell=True, text=True, capture_output=True) if result.returncode != 0: print(f"Command failed with {result.stderr}") return None - return result + output = result.stdout.strip() + return output except Exception as e: logger.error(f"Error executing command: {e}") return None