Skip to content

Commit

Permalink
conky: skip invalid conky errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lasers committed May 8, 2024
1 parent 781e4f6 commit 7e33fcc
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions py3status/modules/conky.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def post_config_hook(self):
self.config.update({"out_to_x": False, "out_to_console": True})
self.separator = "|SEPARATOR|" # must be upper

# make an output.
# make an output
config = dumps(self.config, separators=(",", "=")).replace('"', "")
text = self.separator.join([f"${{{x}}}" for x in conky_placeholders])
tmp = f"conky.config = {config}\nconky.text = [[{text}]]"
Expand All @@ -374,6 +374,12 @@ def post_config_hook(self):
self.tmpfile.close()
self.conky_command = f"conky -c {self.tmpfile.name}".split()

# skip invalid conky errors
self.invalid_conky_errors = [
"conky: invalid setting of type 'table'",
"conky: FOUND:",
]

# thread
self.line = ""
self.error = None
Expand All @@ -393,8 +399,7 @@ def _start_loop(self):
while True:
line = self.process.stdout.readline().decode()
if self.process.poll() is not None or "conky:" in line:
# workaround to https://github.com/brndnmtthws/conky/issues/1479
if "conky: invalid setting of type 'table'" in line:
if any(x in line for x in self.invalid_conky_errors):
continue
raise Exception(line)
if self.line != line:
Expand Down

0 comments on commit 7e33fcc

Please sign in to comment.