reworked generate_text() and fixed spacing bug
This commit is contained in:
parent
cde7b1af0d
commit
71bfac1b53
1 changed files with 5 additions and 6 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue