clipboard

package module
v0.0.0-...-57597cc Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2014 License: BSD-3-Clause Imports: 1 Imported by: 0

README

Build Status Build Status

Clipboard for Go

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/atotto/clipboard

Platforms:

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

Document:

Notes:

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

TODO:

  • BSD support
  • Clipboard watcher(?)

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
package main

import (
	"github.com/atotto/clipboard"

	"fmt"
)

func main() {

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

}
Output:

日本語

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

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