Is there such a thing as a clipboard API in Wayland? Or where should I look to paste contents to the clipboard programmatically?
I am running Fedora 24 on Wayland.
Having a single clipboard if perfectly fine with me, so is there a code example (in Python, etc.)?
wl-clipboard provides wl-copy
and wl-paste
which you can script easily.
Manipulating the clipboard on Wayland usually requires a valid serial for an input event. Some compositors validate this serial (Weston), some don't (Kwin). So it might be that you can't do what you want.
As mentioned by alkino, there are docs here: https://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-data-sharing
And here: https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_data_device
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With