paste/
paste.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
extern crate x11_clipboard;

use std::time::Duration;
use x11_clipboard::Clipboard;


fn main() {
    let clipboard = Clipboard::new().unwrap();
    let val =
        clipboard.load(
            clipboard.setter.atoms.clipboard,
            clipboard.setter.atoms.utf8_string,
            clipboard.setter.atoms.property,
            Duration::from_secs(3)
        )
        .unwrap();
    let val = String::from_utf8(val).unwrap();

    print!("{}", val);
}