Script to apply window rules "always on top" and "Accept focus: no"

Hello,

I am developing an application (python + qml) that needs to be “always on top” but must refuse the focus (“Accept focus” to no in the “Special Window Settings”).

I manage to do it with a right click on the title bar of the window and choosing “Configure Special Window Settings” but I would like to do the same thing in script (for example with dbus or in python or with a KWin script). It does not matter which technique is used.

To be “always on top”, I managed to do it with a KWin script (with the keepAbove property) but I can’t find anything for “Accept focus: No”.

I would like to know how it would be possible to script this functionality like keepAbove.

Thanks a lot for your help and have a nice day.

Nicolas

I have a similar problem

I am also interested in this case: refuse focus. On wayland it is manage by kwin right?
if you have made progress let us know.

Edit: actually it works and create a kwin rule with the intended property, it is possible to tinker condition and property trough the kwin rule editor in SystemSettings. For kwin script I don’t know.

I would be interested to know if it is possible to do it in python.