mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-25 14:05:41 -05:00
f002171c84
Fixes #2567. Fixes #2414.
20 lines
494 B
Rust
20 lines
494 B
Rust
extern crate copypasta;
|
|
|
|
#[cfg(target_os = "linux")]
|
|
use copypasta::x11_clipboard::{Primary, X11ClipboardContext};
|
|
#[cfg(target_os = "linux")]
|
|
use copypasta::ClipboardProvider;
|
|
|
|
#[cfg(target_os = "linux")]
|
|
fn main() {
|
|
let mut ctx = X11ClipboardContext::<Primary>::new().unwrap();
|
|
|
|
let the_string = "Hello, world!";
|
|
|
|
ctx.set_contents(the_string.to_owned()).unwrap();
|
|
}
|
|
|
|
#[cfg(not(target_os = "linux"))]
|
|
fn main() {
|
|
println!("Primary selection is only available under linux!");
|
|
}
|