ov icon indicating copy to clipboard operation
ov copied to clipboard

[FR] Support Wayland clipboard buffer

Open ninetailedtori opened this issue 4 months ago • 2 comments

I do have the documentation for the clipboard buffer for Wayland, and it would be useful as most mainstream comps for Wayland support the wlr-data-control-unstable-v1 protocol now. However I'm pretty dreadful at Golang, so would prefer if it was implemented by someone who knows what they're doing hahah. Emersion's blog post on it is a solid guide to implementing the Wayland clipboard protocol, though in C/++ (my main language hahah).

ninetailedtori avatar Aug 26 '25 19:08 ninetailedtori

Thank you for the issue.

Clipboard support in ov is implemented using atotto/clipboard. However, currently this library does not natively support Wayland. On Wayland environments, clipboard operations only work if XWayland compatibility is available.

Actually, I have already submitted a pull request (atotto/clipboard#59) to add Wayland clipboard support by using wl-copy and wl-paste. The simplest solution would be to use this PR, but unfortunately it has been left unmerged for a long time.

If native Wayland clipboard support is urgently needed, a practical workaround is to use a fork of atotto/clipboard that includes this PR. Alternatively, we may consider implementing a wrapper in ov to directly call wl-copy/wl-paste when running under Wayland.

We will continue to monitor the status of the upstream library and consider these options. Thank you for your suggestion and for bringing up this important issue.

noborus avatar Aug 27 '25 01:08 noborus

Ooh right, this makes sense! It seems quite unlikely that it might go through given the current "dead" state of the repo, it might actually be worth either swapping to an existing maintained fork if that exists (we pray for it), or having ov actually use YOUR maintained fork with the patches, which also allows you to push ov-specific optimising patches alongside the general updating and functionality patches, I suppose! Given it's not a local but a go package, you wouldn't need to actually publish it to package managers outside of the go package manager at all right? I'm not too certain how Golang package management works haha :]

ninetailedtori avatar Aug 27 '25 02:08 ninetailedtori