/
View dependency graph
Depends on
- dh-golang (dh-golang)
- golang-defaults (golang-any)
- debhelper-compat
README (full)
Clipper: cross-platform clipboard library
Platforms supported:
- Linux (via
xcliporxselorwl-copy/wl-paste) - MacOS (via
pbcopy/pbpaste) - Windows (via the Windows clipboard API)
- WSL (via
clip.exe/powershell.exe) - Android Termux (via
termux-clipboard-set/termux-clipboard-get) - Plan9 (via
/dev/snarf) - Anything else (via a user-defined script)
Fallback methods:
- Internal in-memory clipboard
- File-based clipboard
Example
func main() {
clip, err := clipper.GetClipboard(clipper.Clipboards...)
must(err)
// copy from stdin
data, err := io.ReadAll(os.Stdin)
must(err)
err = clip.WriteAll(clipper.RegClipboard, data)
must(err)
// paste to stdout
data, err := clip.ReadAll(clipper.RegClipboard)
must(err)
fmt.Print(string(data))
}
A CLI tool is provided as an example in cmd/clipper.
| dir | cmd/ |
| dir | debian/ |
| file | LICENSE |
| file | LICENSE-EXTRA |
| file | README.md |
| file | clipboard.go |
| file | clipboards_darwin.go |
| file | clipboards_other.go |
| file | clipboards_plan9.go |
| file | clipboards_windows.go |
| file | custom.go |
| file | detect.go |
| file | file.go |
| file | go.mod |
| file | internal.go |
| file | multi.go |
| file | pb.go |
| file | snarf.go |
| file | termux.go |
| file | wayland.go |
| file | winapi.go |
| file | wsl.go |
| file | xclip.go |
| file | xsel.go |