clipboard

package
v0.0.0-...-623eec3 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleRequest

func HandleRequest(conn net.Conn, req models.Request, m *Manager)

func SaveConfig

func SaveConfig(cfg Config) error

Types

type Config

type Config struct {
	MaxHistory     int   `json:"maxHistory"`
	MaxEntrySize   int64 `json:"maxEntrySize"`
	AutoClearDays  int   `json:"autoClearDays"`
	ClearAtStartup bool  `json:"clearAtStartup"`
	Disabled       bool  `json:"disabled"`
}

func DefaultConfig

func DefaultConfig() Config

func LoadConfig

func LoadConfig() Config

type Entry

type Entry struct {
	ID        uint64    `json:"id"`
	Data      []byte    `json:"data,omitempty"`
	MimeType  string    `json:"mimeType"`
	Preview   string    `json:"preview"`
	Size      int       `json:"size"`
	Timestamp time.Time `json:"timestamp"`
	IsImage   bool      `json:"isImage"`
	Hash      uint64    `json:"hash,omitempty"`
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(wlCtx wlcontext.WaylandContext, config Config) (*Manager, error)

func (*Manager) ClearHistory

func (m *Manager) ClearHistory()

func (*Manager) Close

func (m *Manager) Close()

func (*Manager) CopyText

func (m *Manager) CopyText(text string) error

func (*Manager) DeleteEntry

func (m *Manager) DeleteEntry(id uint64) error

func (*Manager) GetConfig

func (m *Manager) GetConfig() Config

func (*Manager) GetEntry

func (m *Manager) GetEntry(id uint64) (*Entry, error)

func (*Manager) GetHistory

func (m *Manager) GetHistory() []Entry

func (*Manager) GetState

func (m *Manager) GetState() State

func (*Manager) PasteText

func (m *Manager) PasteText() (string, error)

func (*Manager) Search

func (m *Manager) Search(params SearchParams) SearchResult

func (*Manager) SetClipboard

func (m *Manager) SetClipboard(data []byte, mimeType string) error

func (*Manager) SetConfig

func (m *Manager) SetConfig(cfg Config) error

func (*Manager) StoreData

func (m *Manager) StoreData(data []byte, mimeType string) error

func (*Manager) Subscribe

func (m *Manager) Subscribe(id string) chan State

func (*Manager) Unsubscribe

func (m *Manager) Unsubscribe(id string)

type SearchParams

type SearchParams struct {
	Query    string `json:"query"`
	MimeType string `json:"mimeType"`
	IsImage  *bool  `json:"isImage"`
	Limit    int    `json:"limit"`
	Offset   int    `json:"offset"`
	Before   *int64 `json:"before"`
	After    *int64 `json:"after"`
}

type SearchResult

type SearchResult struct {
	Entries []Entry `json:"entries"`
	Total   int     `json:"total"`
	HasMore bool    `json:"hasMore"`
}

type State

type State struct {
	Enabled bool    `json:"enabled"`
	History []Entry `json:"history"`
	Current *Entry  `json:"current,omitempty"`
}

Jump to

Keyboard shortcuts

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