All Projects β†’ janlelis β†’ Clipboard

janlelis / Clipboard

Licence: mit
Ruby access to the clipboard on Windows, Linux, macOS, Java, Cygwin, and WSL πŸ“‹οΈŽ

Programming Languages

java
68154 projects - #9 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Clipboard

ZetaHtmlEditControl
A small wrapper class around the Windows Forms 2.0 WebBrowser control.
Stars: ✭ 72 (-76.77%)
Mutual labels:  clipboard
clipboard-files
A nodejs addon, read or write file path for clipboard, support win32 and mac osx.
Stars: ✭ 26 (-91.61%)
Mutual labels:  clipboard
Shapeshifter
A clipboard manager for the 21st century.
Stars: ✭ 256 (-17.42%)
Mutual labels:  clipboard
macos-receiver
A MacOS TabBar (StatusBar) application that securely receives one-time passwords (OTPs) that you tapped in Raivo for iOS.
Stars: ✭ 44 (-85.81%)
Mutual labels:  clipboard
pb
πŸ“‹ Access HTML and other pasteboards from JS and command line
Stars: ✭ 31 (-90%)
Mutual labels:  clipboard
ClipboardText
Universal clipboard text support for PowerShell, notably also in PowerShell Core (cross-platform) and Windows PowerShell v2-v4
Stars: ✭ 37 (-88.06%)
Mutual labels:  clipboard
netflix-list-exporter
πŸ’«β€Žβ€Žβ€Žβ€β€β€Žβ€An Extension to export your lists from Netflix to Clipboard area and share it with your friends.
Stars: ✭ 60 (-80.65%)
Mutual labels:  clipboard
Wsl Ssh Agent
Helper to interface with Windows ssh-agent.exe service from Windows Subsystem for Linux (WSL)
Stars: ✭ 298 (-3.87%)
Mutual labels:  clipboard
My-Business
Business management tool featuring accounts, invoices, partners, projects, and server πŸ¦„
Stars: ✭ 37 (-88.06%)
Mutual labels:  clipboard
Use Clipboard Copy
πŸ“‹ Lightweight copy to clipboard hook for React
Stars: ✭ 256 (-17.42%)
Mutual labels:  clipboard
CLIp
CLIp is a clipboard manager for a command line interface written in 100% standard C only. Pipe to it to copy, pipe from it to paste.
Stars: ✭ 12 (-96.13%)
Mutual labels:  clipboard
x11-clipboard
x11 clipboard support for Rust
Stars: ✭ 28 (-90.97%)
Mutual labels:  clipboard
vimclip
Never type outside vim again
Stars: ✭ 70 (-77.42%)
Mutual labels:  clipboard
clipboard-win
Rust win clipboard utilities
Stars: ✭ 25 (-91.94%)
Mutual labels:  clipboard
Pasteboard Viewer
πŸ“‹ Inspect the system pasteboards on macOS
Stars: ✭ 257 (-17.1%)
Mutual labels:  clipboard
midgard
⛰️ Universal clipboard sharing service (supports macOS/Linux/Windows/iOS)
Stars: ✭ 81 (-73.87%)
Mutual labels:  clipboard
Desktop
A comprehensive solution for convenient and efficient work with notes, snippets, clipboard, files, and other information that requires quick access via any device.
Stars: ✭ 123 (-60.32%)
Mutual labels:  clipboard
Clipjump
πŸ“‹ Clipboard Manager for Windows, built in AutoHotkey
Stars: ✭ 305 (-1.61%)
Mutual labels:  clipboard
React Clipboard.js
React wrapper for clipboard.js (flashless clipboard)
Stars: ✭ 266 (-14.19%)
Mutual labels:  clipboard
react-hook-clipboard
A React hook for accessing clipboard
Stars: ✭ 16 (-94.84%)
Mutual labels:  clipboard

Clipboard Ruby Gem version [ci]

Lets you access the clipboard from everywhere. Currently supported platforms:

  • Linux
  • MacOS
  • Windows
  • Cygwin (POSIX environment for Windows)
  • WSL (Windows Subsystem for Linux)
  • Gtk+ (Cross Platform Widget Toolkit)
  • Java (on JRuby)

Supported Rubies: 3.0, 2.7, 2.6, 2.5

Unsupported, but might still work: 2.4, 2.3, 2.2, 2.1, 2.0

Usage

  • Clipboard.copy - Copies a string to system clipboard
  • Clipboard.paste - Paste contents from system clipboard as string
  • Clipboard.clear - Empties the system clipboard

Setup

Add the following lines to your Gemfile:

gem "clipboard"
gem "ffi", :platforms => [:mswin, :mingw] # Required by Clipboard on Windows
  • Important note for Linux users: The clipboard requires the xsel or the xclip command-line program. On debian and ubuntu, xsel can be installed with: sudo apt-get install xsel

Clipboard Implementations

In most environments, the appropriate clipboard implementation can be detected automatically. If none is found, the gem will fallback to a file based one, which will just write to/read from ~/.clipboard instead of the system clipboard.

You can check the implementation used with: Clipboard.implementation

Alternative Clipboard Providers

There are two implementations included in this gem, which are not used by default. You can opt-in to use them if you think they are a better fit for your application environment:

Java

Activate with: Clipboard.implementation = Clipboard::Java

This is an option for JRuby users which will use the clipboard functionality from the Java standard library.

GTK+

Activate with: Clipboard.implementation = Clipboard::Gtk

This utilizes the GTK+ library. See Ruby-GNOME2 for more info.

Requires the gtk3 or gtk2 gem to be installed.

Tips & Tricks

Linux: Using Clipboard via SSH

To be able to use the clipboard through SSH, you need to install xauth on your server and connect via ssh -X or ssh -Y. Please note that some server settings restrict this feature.

Linux: Paste From Specific X11 Selection

The clipboard on Linux is divided into multiple clipboard selections. You can choose from which clipboard you want to paste from by passing it as an argument. The default is :clipboard, other options are :primary and :secondary.

Clipboard.copy always copies to all three clipboards.

Windows: Encoding Info

Windows uses UTF-16LE as its default encoding, so pasted strings will always come in UTF-16. You can then manually convert them to your desired encoding, for example, UTF-8, using the String#encode method:

Clipboard.paste.encode('UTF-8')

CLI Utility: blip

The blip gem is a handy command-line wrapper for the clipboard gem. It lets you quickly copy file content to your clipboard:

$ blip FILE_NAME

Without any arguments, it will just paste the contents of the clipboard.

MIT

Copyright (c) 2010-2020 Jan Lelis https://janlelis.com released under the MIT license. Contributions by and thanks to Michael Grosser and all the other contributors!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].