Skip to content

Commit

Permalink
conky: add fallback delete parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
lasers committed Dec 23, 2024
1 parent 5d73d00 commit 9fd15ab
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions py3status/modules/conky.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,15 @@ def post_config_hook(self):
tmp = f"conky.config = {config}\nconky.text = [[{text}]]"

# write tmp output to '/tmp/py3status-conky_*', make a command
self.tmpfile = NamedTemporaryFile(
prefix="py3status_conky-", suffix=".conf", delete_on_close=False
)
try:
# python 3.12+
self.tmpfile = NamedTemporaryFile(
prefix="py3status_conky-", suffix=".conf", delete_on_close=False
)
except TypeError:
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()
Expand Down

0 comments on commit 9fd15ab

Please sign in to comment.