fixed run.sh & fixed zero-length string bug
This commit is contained in:
parent
96e6cb2054
commit
3b6fa63e7b
2 changed files with 6 additions and 3 deletions
5
main.py
5
main.py
|
@ -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()
|
||||
return (pre + padding + prefix + cmd_output + padding + post)
|
||||
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
4
run.sh
|
@ -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}"
|
||||
|
|
Loading…
Reference in a new issue