A cross-platform Rust library for system-level clipboard operations supporting text, images, rich text, HTML, files, and change monitoring.
clipboard-rs is a cross-platform Rust library for system-level clipboard operations. It allows developers to programmatically read from and write to the clipboard with support for various data formats including text, images, rich text, HTML, and files. The library solves the problem of inconsistent clipboard APIs across different operating systems by providing a unified interface.
Rust developers building desktop or mobile applications that require advanced clipboard functionality, such as productivity tools, note-taking apps, or GUI frameworks.
Developers choose clipboard-rs for its comprehensive cross-platform support, simple API inspired by Electron, and Rust's safety guarantees, eliminating the need to write platform-specific clipboard code.
Cross-platform clipboard API (text | image | rich text | html | files | monitoring changes) | 跨平台剪贴板 API(文本|图片|富文本|html|文件|监听变化) Windows,MacOS,Linux
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a consistent interface for clipboard operations across Windows, macOS, Linux (X11), and iOS, reducing platform-specific code. The README shows examples that work uniformly with methods like get_text() and get_image().
Handles multiple data types including plain text, HTML, RTF, images (PNG), file lists, and custom formats. The platform comparison table demonstrates broad compatibility for each format.
Enables event-driven listening for clipboard changes via ClipboardWatcher, as shown in the example with ClipboardHandler. This is essential for tools like clipboard managers.
Retrieves clipboard images as RustImage objects, allowing operations like resizing and saving directly, as demonstrated in the image reading example with thumbnail() and save_to_path().
iOS support is labeled as beta, and Android is still in development (WIP), making it unreliable for production mobile applications. The README table marks these with beta or construction icons.
Only supports X11 on Linux, ignoring the growing adoption of Wayland. This restricts usability on modern Linux distributions that default to Wayland, such as Fedora or Ubuntu.
Requires manual configuration to override the default 500ms read timeout on X11 using new_with_options(), adding setup overhead and potential for errors in Linux environments.