#clipboard #cross-platform #x11

crossclip

Crossclip is a cross-platform Rust library for interfacing with the system clipboard

2 releases

Uses new Rust 2021

0.7.1 Jul 24, 2022
0.7.0 Jul 18, 2020

#109 in Unix APIs

Download history 32/week @ 2022-04-22 23/week @ 2022-04-29 27/week @ 2022-05-06 38/week @ 2022-05-13 16/week @ 2022-05-20 22/week @ 2022-05-27 24/week @ 2022-06-03 18/week @ 2022-06-10 24/week @ 2022-06-17 16/week @ 2022-06-24 15/week @ 2022-07-01 39/week @ 2022-07-08 44/week @ 2022-07-15 66/week @ 2022-07-22 47/week @ 2022-07-29 49/week @ 2022-08-05

209 downloads per month
Used in zee

MIT/Apache

24KB
481 lines

Crossclip

Build Status Crates.io Documentation

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

Prerequisites

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

Example

use crossclip::{Clipboard, SystemClipboard, Result};

fn main() -> Result<()> {
    let clipboard = SystemClipboard::new()?;
    clipboard.set_string_contents(String::from("Hello"))?;
    println!("{}", clipboard.get_string_contents()?);
}

License

This project is licensed under either of

at your option.

Contribution

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.

Dependencies

~180KB