A Ruby gem providing cross-platform clipboard access (copy/paste/clear) for Linux, macOS, Windows, Java, and more.
Clipboard is a Ruby gem that provides a simple, cross-platform API for accessing the system clipboard. It allows Ruby applications to copy text to and paste text from the clipboard, supporting multiple operating systems and environments like Linux, macOS, Windows, and Java via JRuby. The gem handles platform-specific details, making clipboard operations consistent and reliable across different setups.
Ruby developers building applications that need to interact with the system clipboard, especially those targeting multiple platforms or requiring clipboard functionality in CLI tools, GUI applications, or scripts.
Developers choose Clipboard for its robust cross-platform support, straightforward API, and automatic detection of the best clipboard implementation for the current environment. It eliminates the need to write platform-specific clipboard code, saving time and reducing complexity.
Ruby access to the clipboard on Windows, Linux, macOS, Java, WSL and more platforms 📋︎
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Works seamlessly across Linux (X11/Wayland), macOS, Windows, Cygwin, WSL, Java (JRuby), and GTK+, with automatic detection of the best provider, as detailed in the README's platform list.
Provides straightforward methods like Clipboard.copy, Clipboard.paste, and Clipboard.clear, abstracting platform complexities for easy integration into Ruby applications.
Enables clipboard usage over SSH via X11 forwarding or OSC52 escape sequences, supporting remote development workflows, as noted in the Tips & Tricks section.
Falls back to a file-based implementation (~/.clipboard) if no system clipboard is available, ensuring functionality even in constrained environments.
Requires external programs like xsel/xclip for X11 or wl-copy/wl-paste for Wayland on Linux, which may not be pre-installed, adding setup complexity.
Only supports plain text operations, lacking features for images, rich text, or other data formats, which restricts use in multimedia or advanced GUI applications.
The OSC52 implementation is experimental and only supports copying (not pasting), and it may be disabled in some terminals for security reasons, as admitted in the README.