KWin support
Current support for KWin is very limited: the tool can be run (with the --only-print option) but it won't move the pointer itself. Also, it cannot take a screenshot given it's using a Wayland interface that is not supported by KWin.
In short, for KWin to be fully supported, we need to be able to:
-
Move the cursor to a specific location and trigger clicks. For this, we could try using the XDG Portal's
RemoteDesktopAPI. -
Take screenshots of a give region. For this, we could try using the KWin's D-Bus
org.kde.KWin.ScreenShot2interface. The XDGScreenshotinterface is too slow for this and uses the former under the hood anyway.
Additionally, we could provide a KWin script (or anything else) to run the program only for the current windows — similar to the wl-kbptr-sway-active-win helper script.
See Lobte.rs discussions:
- https://lobste.rs/s/qgvx5p/wl_kbptr_control_mouse_pointer_with#c_kp54bi
- https://lobste.rs/s/qgvx5p/wl_kbptr_control_mouse_pointer_with#c_q2ioe6
- https://lobste.rs/s/qgvx5p/wl_kbptr_control_mouse_pointer_with#c_y7gz3o
Aks from lobste.rs here, like I said I'm intrigued by this problem so I might give it a try as well if I have time. (Maybe this weekend). Can't promise anything though.
See what else Kwin has https://wayland.app/protocols/kde-fake-input
Also managed to move the mouse cursor in Kwin directly using libei. You can get a socket fd on dbus via org.kde.KWin.EIS.RemoteDesktop.connectToEIS.