Socket
Socket
Sign inDemoInstall

github.com/abdulmelikkalkan/clipboard

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/abdulmelikkalkan/clipboard


Version published
Created
Source

clipboard

Actions Status Doc Go Report Card

This is a multi-platform clipboard library in Go.

Abstract

  • This is clipboard library in Go, which runs on multiple platforms.
  • External clipboard package is not required.

Supported Platforms

  • Windows (Pure Go)
  • macOS (required cgo)

⚠WIP⚠

  • Linux, Unix (X11)

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 and xsel.

Go has an approach to running its own programs as external processes, such as VividCortex/godaemon and 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.

So it turns out that it is not possible to achieve clipboard in Linux as a library.

Installation

go get github.com/d-tsuji/clipboard

API

package clipboard

// Get returns the current text data of the clipboard.
func Get() (string, error)

// Set sets the current text data of the clipboard.
func Set(text string) error

FAQs

Package last updated on 04 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc