Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wayland clipboard API

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.)?

like image 901
anatoly techtonik Avatar asked Sep 21 '16 12:09

anatoly techtonik


2 Answers

wl-clipboard provides wl-copy and wl-paste which you can script easily.

like image 93
Tim Morgan Avatar answered Sep 30 '22 20:09

Tim Morgan


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

like image 21
bobbaluba Avatar answered Sep 30 '22 20:09

bobbaluba