Crates.io | crossclip |
lib.rs | crossclip |
version | 0.7.1 |
source | src |
created_at | 2020-07-18 18:07:54.378591 |
updated_at | 2022-07-24 00:08:44.339225 |
description | Crossclip is a cross-platform Rust library for interfacing with the system clipboard. |
homepage | https://github.com/mcobzarenco/crossclip |
repository | |
max_upload_size | |
id | 266639 |
size | 41,942 |
Crossclip is a cross-platform Rust library for interfacing with the system clipboard. It has been tested on GNU/Linux, FreeBSD, Windows and Mac OSX.
The library is a fork of clipboard2, itself a fork of rust-clipboard
On Linux you need the x11 library. On a Debian-y distribution, install it with something like
sudo apt install xorg-dev libxcb-shape0-dev libxcb-xfixes0-dev
use crossclip::{Clipboard, SystemClipboard, Result};
fn main() -> Result<()> {
let clipboard = SystemClipboard::new()?;
clipboard.set_string_contents(String::from("Hello"))?;
println!("{}", clipboard.get_string_contents()?);
}
This project is licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.