Crate copypasta_ext[][src]

A clipboard library providing useful extensions for the copypasta library.

Here are some of these additions:

Example

Get and set clipboard contents. Keeps contents in X11 clipboard after exit by forking the process. Falls back to standard clipboard provider on non X11 platforms. See x11_fork module for details.

use copypasta_ext::prelude::*;
use copypasta_ext::x11_fork::ClipboardContext;

let mut ctx = ClipboardContext::new().unwrap();
println!("{:?}", ctx.get_contents());
ctx.set_contents("some string".into()).unwrap();

Get and set clipboard contents. Keeps contents in X11 clipboard after exit by invoking xclip/xsel. Falls back to standard clipboard provider on non X11 platforms. See x11_bin module for details.

use copypasta_ext::prelude::*;
use copypasta_ext::x11_bin::ClipboardContext;

let mut ctx = ClipboardContext::new().unwrap();
println!("{:?}", ctx.get_contents());
ctx.set_contents("some string".into()).unwrap();

Requirements

  • Rust 1.41 or above
  • Same requirements as copypasta
  • Requirements noted in specific clipboard context modules

Re-exports

pub use copypasta;

Modules

display

Display server management.

osc52

OSC 52 escape sequence to set clipboard contents.

prelude

Trait prelude.

wayland_bin
x11_bin
x11_fork

Structs

CombinedClipboardContext

Combined, use different clipboard context for getting & setting.

Functions

try_context

Try to get clipboard context.

Type Definitions

ClipResult

Copypasta result type, for your convenience.