luisbocanegra / kde-material-you-colors

Automatic color scheme generator from your wallpaper for KDE Plasma powered by Material You
https://store.kde.org/p/2136963
GNU General Public License v3.0
412 stars 6 forks source link

Screenshot mode doesn't work: Can't get window id when running x11 #180

Closed luisbocanegra closed 9 months ago

luisbocanegra commented 10 months ago

Describe the bug Fails to get window id on x11 session due to missing plasma-kwin_x11 unit in the journalctl command to get the window id:

https://github.com/luisbocanegra/kde-material-you-colors/blob/89eb3ce89664a94c74aaaaed5aff5b4dc26f5f0d/src/kde_material_you_colors/utils/kwin_utils.py#L133C13-L144C14

To Reproduce Steps to reproduce the behavior:

  1. Run kde-material-you-colors in X11 session
  2. Use any wallpaper that triggers screenshot mode
  3. See error in log and notification
[E] kwin_utils: get_desktop_window_id: Script id 1 didn't return a desktop id for screen 0: Command '['journalctl', '--since', '2024-01-12 17:17:15', '--user', '-u', 'plasma-kwin_waylandd.service', '-u', 'plasma-kwin_x11.service', '--output', 'cat', '-g', 'js: KMYC-desktop-window-id']' returned non-zero exit status 1.
Traceback (most recent call last):
  File "/home/luis/projects/kde-material-you-colors/src/kde_material_you_colors/utils/kwin_utils.py", line 149, in get_desktop_window_id
    result = subprocess.run(
             ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['journalctl', '--since', '2024-01-12 17:17:15', '--user', '-u', 'plasma-kwin_waylandd.service', '-u', 'plasma-kwin_x11.service', '--output', 'cat', '-g', 'js: KMYC-desktop-window-id']' returned non-zero exit status 1

Expected behavior A clear and concise description of what you expected to happen.

Desktop (please complete the following information):