#clipboard #file-path #read-file #macos

clipboard-files

Read file paths from the clipboard

2 releases

0.1.1 Jun 13, 2022
0.1.0 Jun 12, 2022

#69 in #read-file

Download history 37/week @ 2024-08-03 53/week @ 2024-08-10 50/week @ 2024-08-17 84/week @ 2024-08-24 80/week @ 2024-08-31 102/week @ 2024-09-07 75/week @ 2024-09-14 30/week @ 2024-09-21 34/week @ 2024-09-28 20/week @ 2024-10-05 24/week @ 2024-10-12 46/week @ 2024-10-19 95/week @ 2024-10-26 39/week @ 2024-11-02 2/week @ 2024-11-09 53/week @ 2024-11-16

194 downloads per month

MIT/Apache

8KB
127 lines

Clipboard Files

This crate lets you read file paths from the system wide clipboard, that are copied from Explorer, Finder, etc.

It's supported on Windows, Linux (using GTK) and MacOS.

Reading

use clipboard_files;

fn main() {
    let files = clipboard_files::read();
    println!(files);
}

Writing

Not supported, mostly due to lack of support in the Linux and Windows upstream crates. Consider filing a PR in those.

Why?

There are several clipboard crates, for instance https://github.com/1Password/arboard. That crate is supported in multiple unix-like environments because it talks X11 directly. This crate uses the GTK bindings for Linux, which offers a much simpler API.

Ideally, all upstream crates should support files. When they do, we'd be better off deleting this one. In the meantime, use this crate.

License

MIT OR Apache-2.0.

Dependencies

~0–3.5MB
~77K SLoC