arboard/examples/hello_world.rs
2024-12-26 13:28:02 -07:00

11 lines
316 B
Rust

use arboard::Clipboard;
fn main() {
env_logger::init();
let mut clipboard = Clipboard::new().unwrap();
println!("Clipboard text was: {:?}", clipboard.get_text());
let the_string = "Hello, world!";
clipboard.set_text(the_string).unwrap();
println!("But now the clipboard text should be: \"{the_string}\"");
}