Remove copypasta and maintain our own fork
This commit is contained in:
parent
b55ba14585
commit
23004b960f
16 changed files with 685 additions and 40 deletions
23
x11/src/lib.rs
Normal file
23
x11/src/lib.rs
Normal 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),
|
||||
)?)?)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue