clipboard

package module
v0.0.0-...-b25936b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2017 License: BSD-3-Clause Imports: 2 Imported by: 1

README

Build Status Build Status

GoDoc

Clipboard for Go

This is a fork of atotto/clipboard which adds support for DragonFly and Plan9.

(atotto/clipboard does not appear to be maintained, so this is just here so I can use for de. I don't expect any significant work on this other than adding new OS support as needed.)

Provide copying and pasting to the Clipboard for Go.

Download shell commands at https://drone.io/github.com/atotto/clipboard/files

Build:

$ go get github.com/driusan/clipboard

Platforms:

  • OSX
  • Windows 7 (probably work on other Windows)
  • Linux, Unix (requires 'xclip' or 'xsel' command to be installed)
  • Plan 9

Document:

Notes:

  • Text string only
  • UTF-8 text encoding only (no conversion)

TODO:

Commands:

paste shell command:

$ go get github.com/atotto/clipboard/cmd/gopaste
$ # example:
$ gopaste > document.txt

copy shell command:

$ go get github.com/atotto/clipboard/cmd/gocopy
$ # example:
$ cat document.txt | gocopy

Documentation

Overview

Package clipboard read/write on clipboard

Example
WriteAll("日本語")
text, _ := ReadAll()
fmt.Println(text)
Output:

日本語

Index

Examples

Constants

This section is empty.

Variables

View Source
var Unsupported bool

Unsupported might be set true during clipboard init, to help callers decide whether or not to offer clipboard options.

Functions

func ReadAll

func ReadAll() (string, error)

ReadAll read string from clipboard

func WriteAll

func WriteAll(text string) error

WriteAll write string to clipboard

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL