clipboard-anywhere

Crates.ioclipboard-anywhere
lib.rsclipboard-anywhere
version0.2.3
sourcesrc
created_at2022-07-25 19:59:42.858992
updated_at2023-12-24 17:56:07.16698
descriptionCopy text to the clipboard, even in WSL and SSH sessions
homepage
repositoryhttps://github.com/rgwood/clipboard-anywhere
max_upload_size
id632809
size16,827
Reilly Wood (rgwood)

documentation

README

clipboard-anywhere

Crates.io

A simple wrapper around arboard that works in a few more situations:

  • In Linux under WSL, it can copy to and from the Windows clipboard (using powershell set-clipboard and powershell get-clipboard)
  • In a remote SSH session, can copy to the local clipboard using the OSC 52 control sequence

Usage

// Attempt to get clipboard contents. Will return error in an SSH session
let clipboard_contents: String = clipboard_anywhere::get_clipboard()?;

// Set clipboard contents to "Hello, world!";
clipboard_anywhere::set_clipboard("Hello, world!")?;

To Do

  • Define custom errors instead of passing everything through Anyhow
  • Write some integration tests
Commit count: 15

cargo fmt