A clipboard for Rust
Find a file
2021-03-22 22:14:14 +01:00
.github/workflows Removed running test on Linux 2020-10-25 15:44:35 +01:00
examples Debug pring events 2021-03-22 22:14:14 +01:00
src Debug pring events 2021-03-22 22:14:14 +01:00
.gitignore Debug pring events 2021-03-22 22:14:14 +01:00
Cargo.toml Replace xcb with x11rb (#9) 2021-03-08 22:28:35 +01:00
CHANGELOG.md Provide the image in CF_BITMAP as well 2020-12-29 20:58:08 +01:00
LICENSE-APACHE.txt Renamed set/get_contents to set/get_text. Updated the license file structure. 2020-05-23 16:19:17 +02:00
LICENSE-MIT.txt Renamed set/get_contents to set/get_text. Updated the license file structure. 2020-05-23 16:19:17 +02:00
LICENSE.txt Renamed set/get_contents to set/get_text. Updated the license file structure. 2020-05-23 16:19:17 +02:00
osx_clipboard_expanded.rs Implemented set_image on macOS. 2020-07-13 16:21:57 +02:00
README.md Remove prerequisites (#10) 2021-03-09 22:11:49 +01:00
rustfmt.toml Implemented set_image on macOS. 2020-07-13 16:21:57 +02:00

Latest version Documentation

General

This is a cross-platform library for interacting with the clipboard. It allows to copy and paste both text and image data in a platform independent way on Linux, Mac, and Windows.

The Linux implementation uses the X protocol for managing the clipboard but fear not because Wayland works with the X11 protocoll just as well. Furthermore this implementation uses the Clipboard selection (as opposed to the primary selection) and it sends the data to the clipboard manager when the application exits so that the data placed onto the clipboard with your application remains to be available after exiting.

This is a fork of rust-clipboard. The reason for forking instead of making a PR is that rust-clipboard is not being maintained anymore. Furthermore note that the API of this crate is considerably different from that of rust-clipboard. There are already a ton of clipboard crates out there which is a bit unfortunate; I don't know why this is happening but while it is, we might as well just start naming the clipboard crates after ourselves. This one is arboard which stands for Artur's clipboard.

Example

use arboard::Clipboard;

fn main() {
	let mut clipboard = Clipboard::new().unwrap();
	println!("Clipboard text was: {}", clipboard.get_text().unwrap());

	let the_string = "Hello, world!";
	clipboard.set_text(the_string.into()).unwrap();
	println!("But now the clipboard text should be: \"{}\"", the_string);
}