Skip to content

Commit

Permalink
conky: add more errors to ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
lasers committed May 8, 2024
1 parent 781e4f6 commit 07f01cd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 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 @@ -372,7 +372,12 @@ def post_config_hook(self):
self.tmpfile = NamedTemporaryFile(prefix="py3status_conky-", suffix=".conf", delete=False)
self.tmpfile.write(str.encode(tmp))
self.tmpfile.close()
self.conky_command = f"conky -c {self.tmpfile.name}".split()

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

# thread
self.line = ""
Expand All @@ -393,8 +398,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.conky_errors):
continue
raise Exception(line)
if self.line != line:
Expand Down

0 comments on commit 07f01cd

Please sign in to comment.