clipboard

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package clipboard reads the host system clipboard.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MIMEToXclipTarget

func MIMEToXclipTarget(mime string) string

MIMEToXclipTarget converts a MIME type to an xclip -target value.

Types

type Content

type Content struct {
	Data     []byte
	MIMEType string // e.g., "text/plain", "image/png"
}

Content holds clipboard data and its MIME type.

func Read

func Read() (content *Content, err error)

Read reads the current clipboard content from the host. Returns nil Content if the clipboard is empty. Returns an error if the clipboard is unavailable on this platform.

func (*Content) IsImage

func (c *Content) IsImage() bool

IsImage returns true if the content is an image type.

Jump to

Keyboard shortcuts

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