This commit is contained in:
JMARyA 2021-05-14 10:59:35 +02:00
commit 956746d3e3
5 changed files with 104 additions and 0 deletions

21
src/main.rs Normal file
View file

@ -0,0 +1,21 @@
use clipboard_macos::*;
use std::{thread, time};
fn main() {
let c = Clipboard::new().unwrap();
let mut cstr = String::new();
let ten_millis = time::Duration::from_millis(10);
loop {
let nstr = c.read();
if nstr.is_err() {
continue;
}
let nstr = nstr.unwrap();
if nstr != cstr {
println!("{}", nstr);
cstr = nstr;
}
thread::sleep(ten_millis);
}
}