1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
extern crate x11_clipboard;
use x11_clipboard::Clipboard;
fn main() {
let clipboard = Clipboard::new().unwrap();
loop {
let val = clipboard
.load_wait(
clipboard.setter.atoms.clipboard,
clipboard.setter.atoms.string,
clipboard.setter.atoms.property,
)
.unwrap();
let val = String::from_utf8(val).unwrap();
println!("{}", val);
}
}