How to properly reload a kwin script

Hello, I want to debug a kwin script but when I add some code in it and reinstall it nothing have changed.

I follow this instruction :

  • made my update in the code (like a console.log for example)
  • uninstall the script via the system settings page
  • run kpackagetool5 --type=KWin/Script -i ~/Downloads/forceblur
  • run qdbus org.kde.KWin /KWin reconfigure
  • activate the script via the system settings page

What I miss ?

My test is pretty simple, I just add a console.log and check if it’s added to my journalctl -f, the only moment it has worked it’s when I rename the kwin script :confused:

I had trouble with it too.

What I found so far is to do 2 DBUS calls:

  1. call org.kde.kwin.Scripting.unloadScript name_of_your_script

  2. Update/reinstall the extensions

  3. call org.kde.kwin.Scripting.start

KWin reconfigure had no effect for me, but “start” reloaded the new new extension nicely.

You can see an example here: https://github.com/ragusa87/kde-tilling-on-drag/blob/main/Makefile