Skip to content

Commit

Permalink
Fix screenshot mode failing frequently
Browse files Browse the repository at this point in the history
- Add small delay before trying to read Desktop window id
- Also fix error caused by no stderr
  • Loading branch information
luisbocanegra committed Jun 22, 2024
1 parent 2c8984c commit d1ab816
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/kde_material_you_colors/utils/kwin_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def get_desktop_window_id(
script = dbus.Interface(kwin, "org.kde.kwin.Script")
timestamp = time.strftime("%Y-%m-%d %H:%M:%S")
script.run()
time.sleep(0.1)
try:
command = [
"journalctl",
Expand Down
2 changes: 1 addition & 1 deletion src/kde_material_you_colors/utils/wallpaper_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def screenshot(self, skip_screenshot):
)
except subprocess.CalledProcessError as e:
logging.exception(e)
self._error = "cmd: " + " ".join(e.cmd) + "\nError: " + e.stderr
self._error = f"cmd {e.cmd}\nError: {e.stderr}"
return
except Exception as e:
logging.exception(e)
Expand Down

0 comments on commit d1ab816

Please sign in to comment.