{"id":13694583,"url":"https://github.com/d-tsuji/clipboard","last_synced_at":"2025-12-30T01:17:11.465Z","repository":{"id":100745022,"uuid":"262680501","full_name":"d-tsuji/clipboard","owner":"d-tsuji","description":"(Experimental) Go library for multi-platform clipboard.","archived":false,"fork":false,"pushed_at":"2020-05-17T02:28:35.000Z","size":19,"stargazers_count":69,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-12T21:38:55.952Z","etag":null,"topics":["clip","clipboard","clipboard-copy","clipboard-library","go","golang","library","linux","macos","multiplatform","windows"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d-tsuji.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-05-09T23:59:07.000Z","updated_at":"2024-01-14T06:44:39.000Z","dependencies_parsed_at":"2023-06-09T12:30:27.726Z","dependency_job_id":null,"html_url":"https://github.com/d-tsuji/clipboard","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-tsuji%2Fclipboard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-tsuji%2Fclipboard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-tsuji%2Fclipboard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-tsuji%2Fclipboard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d-tsuji","download_url":"https://codeload.github.com/d-tsuji/clipboard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252144292,"owners_count":21701381,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clip","clipboard","clipboard-copy","clipboard-library","go","golang","library","linux","macos","multiplatform","windows"],"created_at":"2024-08-02T17:01:35.171Z","updated_at":"2025-12-30T01:17:11.418Z","avatar_url":"https://github.com/d-tsuji.png","language":"Go","funding_links":[],"categories":["开源类库","Open source library"],"sub_categories":["未归类","Not Categorized"],"readme":"# clipboard\r\n\r\n[![Actions Status](https://github.com/d-tsuji/clipboard/workflows/test/badge.svg)](https://github.com/d-tsuji/clipboard/actions)\r\n[![Doc](https://img.shields.io/badge/doc-reference-blue.svg)](https://pkg.go.dev/github.com/d-tsuji/clipboard)\r\n[![Go Report Card](https://goreportcard.com/badge/github.com/d-tsuji/clipboard)](https://goreportcard.com/report/github.com/d-tsuji/clipboard)\r\n\r\nThis is a multi-platform clipboard library in Go.\r\n\r\n## Abstract\r\n\r\n- This is clipboard library in Go, which runs on multiple platforms.\r\n- External clipboard package is not required.\r\n\r\n## Supported Platforms\r\n\r\n- Windows (Pure Go)\r\n- macOS (required cgo)\r\n\r\n### ⚠WIP⚠\r\n\r\n- Linux, Unix (X11)\r\n\r\n*Unfortunately, I don't think it's feasible for Linux to build clipboard library, because xclient needs to be referenced as a daemon in order to keep the clipboard data. This approach is the same for [xclip](https://github.com/astrand/xclip) and [xsel](https://github.com/kfish/xsel).*\r\n\r\n*Go has an approach to running its own programs as external processes, such as [VividCortex/godaemon](https://github.com/VividCortex/godaemon) and [sevlyar/go-daemon](https://github.com/sevlyar/go-daemon). But these cannot be incorporated as a library, of course. xclip and xsel can also be achieved because they are completed as binaries, not libraries.*\r\n\r\n*So it turns out that it is not possible to achieve clipboard in Linux as a library.*\r\n\r\n## Installation\r\n\r\n```\r\ngo get github.com/d-tsuji/clipboard\r\n```\r\n\r\n## API\r\n\r\n```go\r\npackage clipboard\r\n\r\n// Get returns the current text data of the clipboard.\r\nfunc Get() (string, error)\r\n\r\n// Set sets the current text data of the clipboard.\r\nfunc Set(text string) error\r\n```\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-tsuji%2Fclipboard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd-tsuji%2Fclipboard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-tsuji%2Fclipboard/lists"}