kwin-scripts
kwin-scripts copied to clipboard
Install script fails
On an up to date arch linux using plasma 6 the script says:
~/kwin-scripts master ❯ ./helper.sh upgrade virtual-desktops-only-on-primary
kf.coreaddons.desktopparser: Unable to find service type for service "KWin/Script" listed in "/home/myuser/kwin-scripts/virtual-desktops-only-on-primary//metadata.desktop" - service type search directories were ("/home/myuser/.local/share", "/usr/local/share", "/usr/share")
kf.coreaddons.desktopparser: Unable to find service type for service "KWin/Script" listed in "/home/myuser/kwin-scripts/virtual-desktops-only-on-primary/metadata.desktop" - service type search directories were ("/home/myuser/.local/share", "/usr/local/share", "/usr/share")
kf.package: Invalid metadata for package structure "KWin/Script"
Package type "KWin/Script" not found
kf.package: Invalid metadata for package structure "KWin/Script"
kf.package: Cannot set a path in a package without structure "/home/myuser/kwin-scripts/virtual-desktops-only-on-primary"
kf.coreaddons.desktopparser: Unable to find service type for service "KWin/Script" listed in "/home/myuser/kwin-scripts/virtual-desktops-only-on-primary//metadata.desktop" - service type search directories were ("/home/myuser/.local/share", "/usr/local/share", "/usr/share")
kf.coreaddons.desktopparser: Unable to find service type for service "KWin/Script" listed in "/home/myuser/kwin-scripts/virtual-desktops-only-on-primary/metadata.desktop" - service type search directories were ("/home/myuser/.local/share", "/usr/local/share", "/usr/share")
kf.coreaddons.desktopparser: Unable to find service type for service "KWin/Script" listed in "/home/myuser/kwin-scripts/virtual-desktops-only-on-primary/metadata.desktop" - service type search directories were ("/home/myuser/.local/share", "/usr/local/share", "/usr/share")
kf.package: Invalid metadata for package structure "KWin/Script"
kf.coreaddons.desktopparser: Unable to find service type for service "KWin/Script" listed in "/home/myuser/kwin-scripts/virtual-desktops-only-on-primary/metadata.desktop" - service type search directories were ("/home/myuser/.local/share", "/usr/local/share", "/usr/share")
Error: Plugin virtual-desktops-only-on-primary is not installed.
For plasma 6, I have personally modified the script for adapting the new KWin APIs (the KDE's document seems way out of date btw.), https://github.com/hyptrap/kwin-scripts/commit/e5adb4c4fd230c49bcc660f15eeff3a6afb516f4 , but only for the virtual-desktops-only-on-primary script.
For those who want to adapt other scripts, the real API exposed is the Q_PROPERTY part of which files
- https://invent.kde.org/plasma/kwin/-/blob/master/src/scripting/workspace_wrapper.h
- https://invent.kde.org/plasma/kwin/-/blob/master/src/window.h
- https://invent.kde.org/plasma/kwin/-/blob/master/src/core/output.h
Due to incomplete changes for other scripts, no pull request will be made currently🫢.
Many many many thanks for doing this modification and for submitting it here!!!! I am on a leave currently but I will try it out once I get home.
I have tried to enable it but somehow my installation is messed up. Do you know what I should delete to get to an initial state? If I remove the contents of .local/share/kpackage/generic/virtual-desktops-only-on-primary then the install script runs fine according to the output, but the script does not show up in kwin scripts for enablement.
I have tried to enable it but somehow my installation is messed up. Do you know what I should delete to get to an initial state? If I remove the contents of .local/share/kpackage/generic/virtual-desktops-only-on-primary then the install script runs fine according to the output, but the script does not show up in kwin scripts for enablement.
The script directory of (my) Plasma 6 is $HOME/.local/share/kwin/scripts/virtual-desktops-only-on-primary, sorry for forgetting to fix the helper.sh script, now it has been updated at https://github.com/hyptrap/kwin-scripts :)
And I changed the primary screen logic as in https://github.com/wsdfhjxc/kwin-scripts/issues/9#issuecomment-1744811107 issue, but not sure if it can truly address it, you can have a try then.
Many thanks, now it installs and enables just fine. The main screen detection does not wok though (using X11). In the end I have now modified it now to not take the active screen, but rather the 0. element of the screens array (more precisely its name) - so back to the old way. Is there any way I can buy you a coffe? Patreon or similar?
This 0 does not work well either unfortunately. It randomly associates my screens to that position. It would be best if somehow the built-in could be detected.
This 0 does not work well either unfortunately. It randomly associates my screens to that position. It would be best if somehow the built-in could be detected.
For the script I modified may works a little better, except it requires reboot after enabling the script (activeScreen is some how the primary at firsttime the script is loaded).
Or you may hardcode the display name (like HDMI-A-2, you can find it in xrandr in x11, or print them in the script) for the primary screen as a "ugly" workaround for now. Sadly that's KDE's problem for having no API to determine what primary display is :(