From 71bfac1b532807b3d579ab3946bd8dcb9f18bb9f Mon Sep 17 00:00:00 2001 From: Noah Swerhun Date: Wed, 15 Mar 2023 20:44:29 -0500 Subject: [PATCH] reworked generate_text() and fixed spacing bug --- easyconf-lemonbar/Module.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/easyconf-lemonbar/Module.py b/easyconf-lemonbar/Module.py index 980082a..523fbf1 100644 --- a/easyconf-lemonbar/Module.py +++ b/easyconf-lemonbar/Module.py @@ -84,12 +84,11 @@ class Module: self.post += "%{A}" def generate_text(self): - text = self.pre + self.padding + self.prefix - if self.signal != 0: - text += "(" + str(self.signal) + ")" - text += run(self.command, shell=True, capture_output=True, text=True).stdout.strip() - text += self.padding + self.post - self.text = text + command_output = run(self.command, shell=True, capture_output=True, text=True).stdout.strip() + if len(command_output) == 0: + self.text = "" + else: + self.text = self.pre + self.padding + self.prefix + command_output + self.padding + self.post def thread_callback(self): while True: