core-dev 0.0.1

core-dev library is an utility library for rust. It contains a lot of useful functions and APIs to speed up development cycle.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use clipboard_ext::prelude::*;
use clipboard_ext::x11_fork::ClipboardContext;

// https://github.com/timvisee/rust-clipboard-ext
pub fn copy_to_clipboard(text: &str) {
    let mut ctx = ClipboardContext::new().unwrap();
    ctx.set_contents(text.into()).unwrap();
}

pub fn get_clipboard_text() -> String {
    let mut ctx = ClipboardContext::new().unwrap();
    ctx.get_contents().unwrap()
}