Files
clip-sync/internal/clipboard/clipboard.go
T
bruno 5655573fc8
CI / Lint (push) Failing after 14m46s
CI / Test (push) Failing after 4m23s
CI / Build (darwin/amd64) (push) Skipped
CI / Build (linux/amd64) (push) Skipped
CI / Build (windows/amd64) (push) Skipped
CI / Build (darwin/arm64) (push) Skipped
CI / Build (linux/arm64) (push) Skipped
CI / Build (windows/arm64) (push) Skipped
CI / Release (push) Skipped
feat: implémentation complete v0.1.0 — daemon de sync clipboard bidirectionnel
2026-08-08 15:47:22 -04:00

20 lines
794 B
Go

// Package clipboard provides unified clipboard read/write across Linux, Windows, and macOS.
//
// On Linux, it auto-detects X11 (xclip) vs Wayland (wl-clipboard) by checking
// $XDG_SESSION_TYPE and verifying the required binaries at initialization time.
// On Windows, it uses the Win32 clipboard API via syscall (no CGo).
// On macOS, it shells out to pbpaste / pbcopy.
//
// Each platform file defines its own New() constructor using //go:build tags.
package clipboard
// Clipboard is the cross-platform clipboard interface.
type Clipboard interface {
// Read returns the current text content of the clipboard.
// Returns an empty string if the clipboard is empty or contains non-text data.
Read() (string, error)
// Write sets the clipboard text content.
Write(text string) error
}