From 08fa99d7e0275bdc2d34d3ab147ccfc41067cf68 Mon Sep 17 00:00:00 2001 From: lasers Date: Fri, 17 May 2024 09:04:43 -0500 Subject: [PATCH] conky module: skip invalid conky errors (#2248) --- py3status/modules/conky.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/py3status/modules/conky.py b/py3status/modules/conky.py index 6b6a4aad1c..e810656da2 100644 --- a/py3status/modules/conky.py +++ b/py3status/modules/conky.py @@ -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}]]" @@ -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 @@ -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: