fixed run.sh & fixed zero-length string bug

This commit is contained in:
Noah Swerhun 2023-02-16 20:21:42 -06:00
parent 96e6cb2054
commit 3b6fa63e7b
2 changed files with 6 additions and 3 deletions

View file

@ -24,7 +24,10 @@ def print_bar():
def create_module_string(pre, prefix, command, post):
cmd_output = run(command, shell=True, capture_output=True, text=True).stdout.strip()
if cmd_output != "":
return (pre + padding + prefix + cmd_output + padding + post)
else:
return cmd_output
def new_module_thread(alignment, pre, name, prefix, command, post, refresh):

4
run.sh
View file

@ -1,5 +1,5 @@
#!/bin/sh
lemonbar="$(python lemonbar_command.py)"
lemonbar="lemonbar $(python lemonbar_command.py)"
python modules.py | sh -c "${lemonbar}"
python main.py | sh -c "${lemonbar}"