File tree Expand file tree Collapse file tree 5 files changed +60
-8
lines changed Expand file tree Collapse file tree 5 files changed +60
-8
lines changed Original file line number Diff line number Diff line change 11# clipboard [ ![ PkgGoDev] ( https://pkg.go.dev/badge/golang.design/x/clipboard )] ( https://pkg.go.dev/golang.design/x/clipboard ) ![ ] ( https://changkun.de/urlstat?mode=github&repo=golang-design/clipboard ) ![ clipboard] ( https://github.com/golang-design/clipboard/workflows/clipboard/badge.svg?branch=main )
22
3- Cross platform clipboard package in Go
3+ Cross platform (macOS/Linux/Windows/Android/iOS) clipboard package in Go
44
55``` go
66import " golang.design/x/clipboard"
@@ -12,7 +12,7 @@ import "golang.design/x/clipboard"
1212- Copy/paste UTF-8 text
1313- Copy/paste PNG encoded images (Desktop-only)
1414- Command ` gclip ` as a demo application
15- - Mobile app ` Gclip ` as a demo application
15+ - Mobile app ` gclip-gui ` as a demo application
1616
1717## API Usage
1818
@@ -62,6 +62,12 @@ for data := range ch {
6262}
6363```
6464
65+ ## Demos
66+
67+ - A command line tool ` gclip ` for command line clipboard accesses, see document [ here] ( ./cmd/gclip/README.md ) .
68+ - A GUI application ` gclip-gui ` for functionality verifications on mobile systems, see a document [ here] ( ./cmd/gclip-gui/README.md ) .
69+
70+
6571## Command Usage
6672
6773` gclip ` command offers the ability to interact with the system clipboard
Original file line number Diff line number Diff line change 55// Written by Changkun Ou <changkun.de>
66
77/*
8- Package clipboard provides three major APIs for manipulating the
9- clipboard: `Read`, `Write`, and `Watch`. The most common operations are
10- `Read` and `Write`. To use them:
8+ Package clipboard provides cross platform clipboard access and supports
9+ macOS/Linux/Windows/Android/iOS platform. There are three major APIs
10+ to interact with the clipboard: `Read`, `Write`, and `Watch`.
11+
12+ The most common operations are `Read` and `Write`. To use them:
1113
1214 // write/read text format data of the clipboard, and
1315 // the byte buffer regarding the text are UTF8 encoded.
Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ provided in the [GoMobile wiki](https://github.com/golang/go/wiki/Mobile) page.
2222
2323## Screenshots
2424
25- | macOS | iOS |
26- | :------:| :---:|
27- | ![ ] ( ./darwin.png ) | ![ ] ( ./ios.png ) |
25+ | macOS | iOS | Windows |
26+ | :------:| :---:| :------:|
27+ |![ ] ( ./darwin.png ) |![ ] ( ./ios.png ) |![ ] ( ./windows.png )
28+
29+ ## License
30+
31+ MIT | © ; 2021 The golang.design Initiative Authors, written by [ Changkun Ou] ( https://changkun.de ) .
Original file line number Diff line number Diff line change 1+ # gclip
2+
3+ ` gclip ` command offers the ability to interact with the system clipboard
4+ from the shell. To install:
5+
6+ ``` bash
7+ $ go install golang.design/x/clipboard/cmd/gclip@latest
8+ ```
9+
10+ ``` bash
11+ $ gclip
12+ gclip is a command that provides clipboard interaction.
13+ usage: gclip [-copy| -paste] [-f < file> ]
14+ options:
15+ -copy
16+ copy data to clipboard
17+ -f string
18+ source or destination to a given file path
19+ -paste
20+ paste data from clipboard
21+ examples:
22+ gclip -paste paste from clipboard and prints the content
23+ gclip -paste -f x.txt paste from clipboard and save as text to x.txt
24+ gclip -paste -f x.png paste from clipboard and save as image to x.png
25+ cat x.txt | gclip -copy copy content from x.txt to clipboard
26+ gclip -copy -f x.txt copy content from x.txt to clipboard
27+ gclip -copy -f x.png copy x.png as image data to clipboard
28+ ```
29+
30+ If ` -copy ` is used, the command will exit when the data is no longer
31+ available from the clipboard. You can always send the command to the
32+ background using a shell ` & ` operator, for example:
33+
34+ ``` bash
35+ $ cat x.txt | gclip -copy &
36+ ```
37+
38+ ## License
39+
40+ MIT | © ; 2021 The golang.design Initiative Authors, written by [ Changkun Ou] ( https://changkun.de ) .
You can’t perform that action at this time.
0 commit comments