clipboard

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package clipboard provides a thin wrapper for writing to and reading from the system clipboard. It uses platform-native CLI tools (xclip/xsel/wl-copy on Linux, pbcopy/pbpaste on macOS, clip.exe/PowerShell on Windows) so that no CGO or display-server headers are required at build time. Availability is determined at runtime by probing for the tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Available

func Available() bool

Available reports whether a clipboard tool was found on this system.

func Read added in v0.5.0

func Read() (string, error)

Read retrieves text from the system clipboard. Returns an error when no suitable clipboard tool is available.

func Write

func Write(text string) error

Write copies text to the system clipboard. Returns an error when no suitable clipboard tool is available.

Types

This section is empty.

Jump to

Keyboard shortcuts

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