rust-clipboard icon indicating copy to clipboard operation
rust-clipboard copied to clipboard

Binary clipboard

Open anna-is-cute opened this issue 8 years ago • 4 comments

Being able to read the clipboard as a vector or slice of u8s would be extremely useful to anyone who needs to work with the clipboard not just with strings.

I know this is feasible in Windows, and I think it can be done in macOS (from what I read of the current implementation), but I don't know about in X11.

anna-is-cute avatar Nov 19 '17 15:11 anna-is-cute

I agree that this would be a useful feature. I'm willing to accept a PR that adds support for the platforms that you're willing to implement it for, and I'll add support for the rest of the platforms (it should be feasible under X11 too).

aweinstock314 avatar Dec 07 '17 12:12 aweinstock314

Has there been any progress on this?

I am willing to work on an X11 version. I am sure that it can be done because I have written a Java application which copies images from the system clipboard from a different graphics application under Linux. I think that is a proof of concept, at least.

Multiple things can be in the clipboard at the same time, which might require changes to your elegant clipboard.

NomadMaker avatar May 15 '18 09:05 NomadMaker

I am also looking for this functionality... Got a panic when calling Result::unwrap() on ctx.get_contents() when trying to read image data:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: StringError("pasteboard#readObjectsForClasses:options: returned empty")', libcore/result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

rickycodes avatar Jul 04 '18 22:07 rickycodes

Check this https://github.com/SpiralP/rust-clip-sys

leiserfg avatar Sep 21 '19 14:09 leiserfg