fix i3status path detection and setting on startup
@@ -15,8 +15,11 @@ def parse_cli():
# get i3status path
try:
+ with open(os.devnull, "w") as devnull:
command = ["which", "i3status"]
- i3status_path = subprocess.check_output(command).decode().strip()
+ i3status_path = (
+ subprocess.check_output(command, stderr=devnull).decode().strip()
+ )
except subprocess.CalledProcessError:
i3status_path = None
@@ -155,5 +158,9 @@ def parse_cli():
print("py3status version {} (python {})".format(version, python_version()))
sys.exit(0)
+ # make it i3status if None
+ if not options.i3status_path:
+ options.i3status_path = "i3status"
+
# all done
return options
