Git Product home page Git Product logo

arboard's Introduction

Latest version Documentation

General

This is a cross-platform library for interacting with the clipboard. It allows to copy and paste both text and image data in a platform independent way on Linux, Mac, and Windows.

Linux

The Linux implementation uses the X protocol by default for managing the clipboard but fear not because Wayland works with the X11 protocol just as well. Furthermore this implementation uses the Clipboard selection (as opposed to the primary selection) and it sends the data to the clipboard manager when the application exits so that the data placed onto the clipboard with your application remains to be available after exiting.

There's also an optional wayland data control backend through the wl-clipboard-rs crate. This can be enabled using the wayland-data-control feature. When enabled this will be prioritized over the X11 backend, but if the initialization fails, the implementation falls back to using the X11 protocol automatically. Note that in my tests the wayland backend did not keep the clipboard contets after the process exited. (Although neither did the X11 backend on my Wayland setup).

Example

use arboard::Clipboard;

fn main() {
	let mut clipboard = Clipboard::new().unwrap();
	println!("Clipboard text was: {}", clipboard.get_text().unwrap());

	let the_string = "Hello, world!";
	clipboard.set_text(the_string.into()).unwrap();
	println!("But now the clipboard text should be: \"{}\"", the_string);
}

Yet another clipboard crate

This is a fork of rust-clipboard. The reason for forking instead of making a PR is that rust-clipboard is not being maintained anymore. Furthermore note that the API of this crate is considerably different from that of rust-clipboard. There are already a ton of clipboard crates out there which is a bit unfortunate; I don't know why this is happening but while it is, we might as well just start naming the clipboard crates after ourselves. This one is arboard which stands for Artur's clipboard.

arboard's People

Contributors

akosthekiss avatar aldaronlau avatar arturkovacs avatar aweinstock314 avatar booyaa avatar complexspaces avatar daggerbot avatar dashdashzako avatar daxpedda avatar est31 avatar iceiix avatar jonasmalacofilho avatar liamkearn avatar mathieulj avatar mathphreak avatar mattx avatar mbrubeck avatar metajack avatar mneumann avatar ms2ger avatar muja avatar paulrouget avatar quininer avatar rickycodes avatar sabrinajewson avatar simonsapin avatar ssheldon avatar tkerber avatar uk992 avatar xanderio avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.