Remove copypasta and maintain our own fork

This commit is contained in:
Héctor Ramón Jiménez 2019-12-19 05:47:36 +01:00
parent b55ba14585
commit 23004b960f
16 changed files with 685 additions and 40 deletions

23
x11/src/lib.rs Normal file
View file

@ -0,0 +1,23 @@
mod clipboard;
mod error;
pub use xcb::*;
use std::error::Error;
pub struct Clipboard(clipboard::Clipboard);
impl Clipboard {
pub fn new() -> Result<Clipboard, Box<dyn Error>> {
Ok(Clipboard(clipboard::Clipboard::new()?))
}
pub fn read(&self) -> Result<String, Box<dyn Error>> {
Ok(String::from_utf8(self.0.load(
self.0.getter.atoms.clipboard,
self.0.getter.atoms.utf8_string,
self.0.getter.atoms.property,
std::time::Duration::from_secs(3),
)?)?)
}
}