bugaevc / wl-clipboard

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

Feature Request: Make wl-copy able to copy videos/gifs #178

Open GiorgosAthanasopoulos opened 1 year ago

GiorgosAthanasopoulos commented 1 year ago

Hello everyone, On my free time I enjoy watching some coding channels on twitch, such as prime and tj. I like the emotes that they use over at twitch, so much that I actually like to use them daily in my conversations on other messenger apps such as whatsapp and messenger. On windows, i can just copy them from the file explorer and they are interpreted correctly as vids/gifs. In linux, on the other hand, the best im able to do is copy raw and thats interpreted as an image (it copies the first frame) otherwise its interpreted as raw text (like opening the file in vim and copying raw text). So this is what my feature request is about. Make wl-copy able to copy gifs, as in windows, and interpreter them correctly as vids/gifs (not static images).

(Just a note: Ive tried using wl-clipboard, copyq, and some python libraries because of a script im writing and none of them seem to work. Seeing as wl-clipboard is the most famous option for a clipboard manager in hyprland right now, I thought this is the repo id do the feature request on.)

Thank you very much for your time, George.

bugaevc commented 1 year ago

Hi!

So this is what my feature request is about. Make wl-copy able to copy gifs, as in windows, and interpreter them correctly as vids/gifs (not static images).

Are you sure wl-copy cannot do that yet?

What wl-copy surely does not do is interpret binary content in any way, certainly it does not care whether it's a video or a static image. wl-copy's job is to copy the bytes from the input file to the Wayland clipboard. What most likely doesn't work for you is the client that you're trying to paste the GIF into -- that would be your browser, if that's how you watch Twitch.

Does wl-copy correctly set the MIME type to image/gif when copying? You can use wl-paste --list-types to verify, like this:

$ wl-copy < my-emote.gif
$ wl-paste --list-types
image/gif

So if it does, please file a bug against your browser that you use Twitch in, and tell them that they don't support pasting GIFs from the clipboard properly.

aurelien-brabant commented 11 months ago

Hey,

I also have this issue on Linux, where I can't get a paste offering image/gif to be interpreted as a proper gif paste on an Electron app (while uploading via their file uploader works). This does not seem related to wl-copy though, as copying the data and pasting it back gives exactly the same file in the end. So the only thing I can think of is an Electron bug at this point.

aurelien-brabant commented 11 months ago

To give an update on this, it really seems to be an Electron + Xwayland issue and by no mean a wl-copy related one. Forcing electron apps to use the wayland platform solves it. (Tested with Slack in my case)