wl-kbptr icon indicating copy to clipboard operation
wl-kbptr copied to clipboard

KWin support

Open moverest opened this issue 7 months ago • 3 comments

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 RemoteDesktop API.
  • Take screenshots of a give region. For this, we could try using the KWin's D-Bus org.kde.KWin.ScreenShot2 interface. The XDG Screenshot interface 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

moverest avatar Jun 03 '25 15:06 moverest

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.

Akselmo avatar Jun 03 '25 19:06 Akselmo

See what else Kwin has https://wayland.app/protocols/kde-fake-input

Gliese852 avatar Sep 15 '25 14:09 Gliese852

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.

Gliese852 avatar Sep 18 '25 14:09 Gliese852