Wl-copy not working

I installed wl-clipbord, but x-copy does not work as expected.

For example :

echo test | wl-copy

Makes wl-copy appears on the dash panel. Then I have to click on it to make it quit.

It makes the copy to the clipboard, but I am not expecting to have to click something in the dash panel to make it work.

I tried with some extension deactivated : Dash to Dock and Pano - Clipboard Manager. But, the problem stays the same.

Any idea on this issue?

NixOS 23.11, Gnome desktop.

Huh, didn’t know it had a tray option. Apparently you can use wl-copy -o if you don’t want to use the tray.

Not a NixOS issue, in either case, this is squarely within upstream’s domain.

wl-clipboard will work on GNOME/Mutter, but note that due to the security design of Wayland, it can’t always work very well. The trouble is that in Wayland, usually only the focused surface can access or manipulate the clipboard, and nominally CLI programs don’t have a surface to begin with. On wlroots-based compositors, this can be mitigated using the wlr-data-control protocol, but GNOME doesn’t support that, so wl-clipboard needs another hack to work. If it is unable to steal focus briefly, e.g. because an always-on-top window is being displayed, it may not work as intended.

Are you using a terminal that is “always on top”, like a dropdown terminal?

(It’s also possible some setting or extension is interfering with wl-copy’s ability to temporarily get a surface focused, too.)

2 Likes

I am using Guake. But I also tried with another terminal app and the issue remains the same.

I decided to use X11 instead of Wayland. Now, I can use xsel instead of wl-copy.

Thank you for the information.