Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't play nice with Wallpaper Engine KDE #199

Open
cacklinglaughing opened this issue May 16, 2024 · 22 comments
Open

doesn't play nice with Wallpaper Engine KDE #199

cacklinglaughing opened this issue May 16, 2024 · 22 comments
Labels
backend bug Something isn't working plasma5

Comments

@cacklinglaughing
Copy link

Describe the bug
Gets stuck in a bug loop when trying to use screenshot mode with wallpaper engine KDE.

To Reproduce
Steps to reproduce the behavior:
Install Wallpaper engine for KDE, set it to a wallpaper from there, install the screenshot helper, run kde material you colors.

Expected behavior
Should take the color scheme from the background.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context

[E] main: main: Could not get wallpaper Command 'Command '['journalctl', '--since', 'TIME_NOW', '--user', '-u', 'plasma-kwin_wayland.service', '-u', 'plasma-kwin_x11.service', '--output', 'cat', '-g', 'js: KMYC-desktop-window-id']' returned non-zero exit status 1.' returned non-zero exit status 1.
[D] main: main: {'light': None, 'file': None, 'monitor': 0, 'ncolor': 0, 'iconslight': None, 'iconsdark': None, 'pywal': None, 'pywal_light': None, 'light_blend_multiplier': 1, 'dark_blend_multiplier': 1, 'on_change_hook': None, 'sierra_breeze_buttons_color': None, 'disable_konsole': False, 'titlebar_opacity': 100, 'titlebar_opacity_dark': 100, 'toolbar_opacity': 100, 'toolbar_opacity_dark': 100, 'konsole_opacity': 100, 'konsole_opacity_dark': 100, 'color': None, 'klassy_windeco_outline': None, 'custom_colors_list': None, 'darker_window_list': None, 'use_startup_delay': None, 'startup_delay': 0, 'plasma_follows_scheme': None, 'pywal_follows_scheme': None, 'main_loop_delay': 1, 'screenshot_delay': 900, 'once_after_change': False, 'pause_mode': False}
[E] kwin_utils: get_desktop_window_id: Script id 0 didn't return a desktop id for screen 0: Command '['journalctl', '--since', '2024-05-16 04:15:13', '--user', '-u', 'plasma-kwin_wayland.service', '-u', 'plasma-kwin_x11.service', '--output', 'cat', '-g', 'js: KMYC-desktop-window-id']' returned non-zero exit status 1.

And

[I] plasma_utils: get_initial_mode: Using theme from stored name
[I] main: main: Wallpaper: com.github.casout.wallpaperEngineKde (screenshot): None
@cacklinglaughing
Copy link
Author

Not really related to this issue but when it does work with the image plugin it says plasma-apply color scheme returned non-zero exit status 134, and when you run the command it tries to run you get

qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Aborted (core dumped)

I can make that a separate issue if you want.

@luisbocanegra
Copy link
Owner

luisbocanegra commented May 16, 2024

Looks like the problem is with the code that finds the desktop (needs the window id so the screenshot-helper can take a screenshot of it). I will need you to check why the script isn't returning the window id to journalctl output.

  1. Run plasma-interactiveconsole --kwin
  2. Paste this code:
print("SHOULD SEE THIS ON journalctl output")
var windows = workspace.clientList()
for (var i = 0; i < windows.length; i++) {
    let window = windows[i];
    var regex = /Desktop @ QRect\\((.*?)\\) — Plasma/;
    if (window.caption.match(regex) != null && window.screen == 0) {
        print("KMYC-desktop-window-id:", window.internalId)
    }
}
  1. Open a second terminal and run journalctl -f
  2. With the journal running go back to the Desktop Shell Scripting Console and click Execute

In the journal output you should see something like this

May 15 22:59:05 archlinux kwin_wayland[1919]: js: SHOULD SEE THIS ON journalctl output
May 15 22:59:05 archlinux kwin_wayland[1919]: js: KMYC-desktop-window-id: {7aa1a476-ee08-4873-8644-88a5f191152c}

If you don't see any output this means logging is disabled and you need to do this https://develop.kde.org/docs/plasma/kwin/#output and restart:

# ~/.config/QtProject/qtlogging.ini
[Rules]
kwin_scripting=true
qml.debug=true

If you see an error instead please share the complete output

@luisbocanegra
Copy link
Owner

Not really related to this issue but when it does work with the image plugin it says plasma-apply color scheme returned non-zero exit status 134, and when you run the command it tries to run you get

qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Aborted (core dumped)

I can make that a separate issue if you want.

Yes please make a separate issue

@cacklinglaughing
Copy link
Author

plasma-interactiveconsole --kwin

Same core dumped

@luisbocanegra
Copy link
Owner

What core dumped, plasma-interactiveconsole --kwin or KWin?

@cacklinglaughing
Copy link
Author

@pop-os:~$ plasma-interactiveconsole --kwin
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Aborted (core dumped)

@luisbocanegra
Copy link
Owner

luisbocanegra commented May 16, 2024

That's very strange, looks like for some reason it isn't able to find the display:

My guess is you're missing the environment variable necessary to point plasmashell to the correct display from the TTY, probably DISPLAY.

I think there is a problem with how your Plasma Session is started, probably you need to configure the display manager (e.g. sddm, gdm) to start Plasma properly https://www.reddit.com/r/kde/comments/zoxmsa/i_cant_seem_to_launch_kde_plasma_desktop/

@cacklinglaughing
Copy link
Author

This is how I learn those commands don't work over ssh. That command launches in the Konsole terminal. I'll do the rest of your steps now. Thank you for the help.

@cacklinglaughing
Copy link
Author

I see "SHOULD SEE THIS" but no window id.

@luisbocanegra
Copy link
Owner

luisbocanegra commented May 16, 2024

Okay, looks like it isn't matching the desktop window properly, please replace the code with this:

print("SHOULD SEE THIS ON journalctl output")
var windows = workspace.clientList()
for (var i = 0; i < windows.length; i++) {
    let window = windows[i];
    print(window.caption)
    var regex = /Desktop @ QRect\\((.*?)\\) — Plasma/;
    if (window.caption.match(regex) != null && window.screen == 0) {
        print("KMYC-desktop-window-id:", window.internalId)
    }
}

It should print the window titles of all the windows (on screen 0) including the desktop

@cacklinglaughing
Copy link
Author

It shows window titles, yes. but no ids.

@luisbocanegra
Copy link
Owner

luisbocanegra commented May 16, 2024

Yes I need to see the titles so I can adapt the matching. Last Plasma 5 version I used was 5.27.10, and the matching worked there, but apparently 5.24.7 shows Desktop window tittle differently

For context in Plasma 6 the desktop window doesn't even show titles (and I had to change the matching) so this can to change between releases.

@cacklinglaughing
Copy link
Author

May 16 22:29:59 pop-os /usr/libexec/gdm-x-session[29648]: js: SHOULD SEE THIS ON journalctl output
May 16 22:29:59 pop-os /usr/libexec/gdm-x-session[29648]: js: Desktop — Plasma
May 16 22:29:59 pop-os /usr/libexec/gdm-x-session[29648]: js: Plasma
May 16 22:29:59 pop-os /usr/libexec/gdm-x-session[29648]: js: doesn't play nice with Wallpaper Engine KDE · Issue #199 · luisbocanegra/kde-material-you-colors · GitHub — Mozilla Firefox
May 16 22:29:59 pop-os /usr/libexec/gdm-x-session[29648]: js: - : sudo bash — Konsole
May 16 22:29:59 pop-os /usr/libexec/gdm-x-session[29648]: js: Steam
May 16 22:29:59 pop-os /usr/libexec/gdm-x-session[29648]: js: About this System — System Settings
May 16 22:29:59 pop-os /usr/libexec/gdm-x-session[29648]: js: Unsaved* — Spectacle
May 16 22:29:59 pop-os /usr/libexec/gdm-x-session[29648]: js: Download New Plasma Widgets — Plasma
May 16 22:29:59 pop-os /usr/libexec/gdm-x-session[29648]: js: Desktop Folder Settings — Plasma
May 16 22:29:59 pop-os /usr/libexec/gdm-x-session[29648]: js: ~ : bash — Konsole
May 16 22:29:59 pop-os /usr/libexec/gdm-x-session[29648]: js: Desktop Shell Scripting Console

@luisbocanegra
Copy link
Owner

Thanks, this one should return the id

print("SHOULD SEE THIS ON journalctl output")
var windows = workspace.clientList()
for (var i = 0; i < windows.length; i++) {
    let window = windows[i];
    var regex = /Desktop — Plasma/;
    if (window.caption.match(regex) != null && window.screen == 0) {
        print("KMYC-desktop-window-id:", window.internalId)
    }
}

Can you confirm it works? I can push fixes to plasma5 branch. But since I don't have a plasma 5 install so you will need to download the code and test manually e.g:

git clone https://github.com/luisbocanegra/kde-material-you-colors -b plasma5
cd kde-material-you-colors
rm -rf build
# Creatine and activate virtual environment
mkdir -p build/testenv
python -m venv build/testenv
source build/testenv/bin/activate

# Install project to environment
pip install -e .
pip install pywal16
echo -e "Done"
echo -e "\nRun build/testenv/bin/kde-material-you-colors"

If I recall correctly the widget is also broken for that version, if you want to help testing that too let me know and I will try to support 5.24.7 without breaking the latest Plasma 5 version which i can test in a VM.

@luisbocanegra
Copy link
Owner

If you want to make the change yourself here's the line you have to change

var regex = /Desktop @ QRect\\((.*?)\\) — Plasma/;

to var regex = /Desktop — Plasma/;

@cacklinglaughing
Copy link
Author

Yes this top script returns an id

@luisbocanegra
Copy link
Owner

luisbocanegra commented May 16, 2024

Good, let me know if you want to make/test/submit the change by yourself and feel free to send me an email to luisbocanegra17b at gmail dot com or telegram (same user as github) if you have any question or just want to test the patches

@luisbocanegra
Copy link
Owner

Just pushed 432c875 in case you want to try it out.

Btw now I am wondering if that string is translated as I never tested a language other than English...

@cacklinglaughing
Copy link
Author

Seemingly same issue

@luisbocanegra
Copy link
Owner

Hmm will try fixing it after #126 and the Open Build Service packages are done.

@luisbocanegra luisbocanegra added bug Something isn't working backend plasma5 labels May 17, 2024
@cacklinglaughing
Copy link
Author

I could upgrade to Plasma 6, I'm not quite sure how seeing as all I did to install KDE over GNOME in the first place was apt-install kde-standard.

@luisbocanegra
Copy link
Owner

AFAIK there is no Plasma 6 packages for ubuntu yet and it may take a while before it is available (could be until october according to some random reddit comment).
I you don't want to wait you can switch to other distribution https://community.kde.org/Distributions that ships Plasma 6 by default like fedora KDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working plasma5
Projects
None yet
Development

No branches or pull requests

2 participants