passgo/impl_linux.go

17 lines
217 B
Go

//+build linux
package passgo
import (
"bytes"
"os/exec"
)
//Clip copies a string to the clipboard
func Clip(x string) {
b := bytes.NewBuffer([]byte(x))
cmd := exec.Command("xclip")
cmd.Stdin = b
cmd.Run()
}