modified script for plasma 6 api
These are the changes for the plasma 6 api. This script is still not installable.
When trying to install it does copy the folder over and edit the kwinrc file, however we get this error.
qt.dbus.integration: QDBusConnection: error: could not send signal to service "" path "/KPackage/" interface "org.kde.plasma.kpackage" member "packageInstalled": Invalid object path: /KPackage/
Maybe it's with the kpackagetool6 command. When I list-types it's a bit different.
KPackageTool5
╰─λ kpackagetool5 --list-types
Package types that are installable with this tool:
Built in:
KPackage Structure Name Path
----------------------- --------------------
KPackage/Generic kpackage/packages/
KPackage/GenericQML kpackage/genericqml/
Provided by plugins:
KPackage Structure Name Path
------------------------- --------------------------
Plasma/Applet plasma/plasmoids/
Plasma/ContainmentActions plasma/containmentactions/
Plasma/DataEngine plasma/dataengines/
Plasma/Generic plasma/packages/
Plasma/Theme plasma/desktoptheme/
KPackageTool6
╰─λ kpackagetool6 --list-types
Package types that are installable with this tool:
Built in:
KPackage Structure Name Path
----------------------- --------------------
KPackage/Generic kpackage/packages/
KPackage/GenericQML kpackage/genericqml/
Provided by plugins:
KPackage Structure Name Path
------------------------- --------------------------
KSysguard/SensorFace ksysguard/sensorfaces/
KWin/Aurorae aurorae/themes/
KWin/Decoration kwin/decorations/
KWin/Effect kwin/effects/
KWin/Script kwin/scripts/
KWin/WindowSwitcher kwin/tabbox/
Plasma/Applet plasma/plasmoids/
Plasma/Comic plasma/comics/
Plasma/ContainmentActions plasma/containmentactions/
Plasma/Generic plasma/packages/
Plasma/LayoutTemplate plasma/layout-templates/
Plasma/LookAndFeel plasma/look-and-feel/
Plasma/Shell plasma/shells/
Plasma/Theme plasma/desktoptheme/
Plasma/Wallpaper plasma/wallpapers/
Wallpaper/Images
Thanks @zzag . I'm not really familiar with KDE scripting. I jumped into this to really just get swap sides back. Any idea on why the install will not work?
Thanks @zzag . I'm not really familiar with KDE scripting. I jumped into this to really just get swap sides back. Any idea on why the install will not work?
He replied elsewhere with
metadata.desktop file should be converted to metadata.json and in metadata.json, ServiceTypes: ["KWin/Script"] should be replaced with "KPackageStructure": "KWin/Script" KPackageStructure should be in the toplevel object i.e.
{ "KPackageStructure": "KWin/Script", "KPlugin" : {} }
For the metadata file conversion there is a command-line tool, desktoptojson, part of the kcoreaddons package.
The metadata structure is the one reflected now in https://develop.kde.org/docs/plasma/kwin/#metadata.
I can take a shot at it in the coming days but if you want to finish it up go ahead :)
I converted to metadata.json and made sure it looked like the example. However, the shortcut is not swapping windows. I'm not really sure how to debug in Plasma, but it does seem like we are getting there and hopefully, finishing this will allow the other scripts to be updated as well.
Also change win.geometry to win.frameGeometry in lines 22 27 59 64 maybe it will work then
@mashrit That did not work. I even tried changing it on 32, 39, 69 and 76 for good measure. No-go.
Sorry i did not see those on the loop lines, But from what i know geometry was changed to frameGeometry
On here https://invent.kde.org/plasma/kwin/-/wikis/Porting-your-scripts-to-KWin-6
It says workspace.clientlist() is replaced by workspace.clients
Hello @mashrit ,
I tried that change and it still didn't work. Based on the advice here for some debugging (although I don't really think it helped), I ran the command below and grabbed the output of running the keyboard shortcut.
export QT_LOGGING_RULES='*.debug=true; js=true; kwin_scripting=true'
kwin_x11 --replace &
journalctl -g "js:" -f
And here is what I got:
js: swapsides: left and right
qt.qml.overloadresolution: ::: considering signature "clientArea(ClientAreaOption,const KWin::Window*)"
qt.qml.overloadresolution: updated best bestParameterScore 0
bestMaxMatchScore 4
bestSumMatchScore 4
qt.qml.overloadresolution: ::: considering signature "clientArea(ClientAreaOption,KWin::Window*)"
qt.qml.overloadresolution: did not update best
bestParameterScore 0 methodParameterScore 0
bestMaxMatchScore 4 maxMethodMatchScore 4
bestSumMatchScore 4 sumMethodMatchScore 4
qt.qml.overloadresolution: ::: considering signature "clientArea(ClientAreaOption,KWin::Output*,KWin::VirtualDesktop*)"
qt.qml.overloadresolution: rejected, insufficient arguments
Okay. I'm not sure what happened, but this code now seems to work. clients() didn't work, but windowList() does.
If someone else can verify it working with their setup, I think it can be pushed to main and used as a reference for the rest of the repo.
@mashrit @nclarius @zzag Thank you all so much for your help!
working for me(Wayland)
It seems having panels in way messes somethings up for me window sizes change when swapped and go back when swapped again