bugaevc / wl-clipboard

Command-line copy/paste utilities for Wayland
GNU General Public License v3.0
1.62k stars 59 forks source link

Question: How xclip is working on my Wayland? #151

Closed lamyergeier closed 2 years ago

lamyergeier commented 2 years ago

OS: Ubuntu 22.04.1

$ loginctl show-session $(loginctl | grep $(whoami) | awk '{print $1}') -p Type
Type=wayland

Copy the current path:

printf '%s' "${PWD}"  | xclip -selection clipboard

This works! How is it possible, as I am running wayland?

YaLTeR commented 2 years ago

Wayland compositors generally use Xwayland to be able to seamlessly run X11 software, of which there's still a lot. This includes forwarding clipboard, and xclip is a regular X11 client.

Also, how's this related to wl-clipboard?..

lamyergeier commented 2 years ago

Also, how's this related to wl-clipboard?..

I was wondering if xclip is already working why do we need wl-clipboard.

YaLTeR commented 2 years ago

Well at least because X11 is getting phased out, with each passing year it becomes more viable to run a pure-Wayland desktop (I'm sure some people already do it), and they might need an xclip replacement.