From bf1709dc4ca87622f98b50d56c7528f9f3622559 Mon Sep 17 00:00:00 2001 From: Greg Date: Tue, 1 Oct 2019 13:54:35 -0400 Subject: [PATCH] Convert to git.wow.st/gmp/clip for Darwin clipboard. --- go.mod | 1 + go.sum | 2 ++ impl_darwin.go | 8 +++----- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index 1684a51..576526c 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.12 require ( gioui.org/ui v0.0.0-20190918172808-816f0e901fc6 + git.wow.st/gmp/clip v0.0.0-20191001134149-1458ba6a7cf5 github.com/fsnotify/fsnotify v1.4.7 github.com/jcmdev0/gpgagent v0.0.0-20180509014935-5601b32d936c golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7 diff --git a/go.sum b/go.sum index 97e73fc..86dd242 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ gioui.org/ui v0.0.0-20190918172808-816f0e901fc6 h1:LvHEYxyOW7g+PhOiAm8Delc3AUv9EH219oDvaUMeKBw= gioui.org/ui v0.0.0-20190918172808-816f0e901fc6/go.mod h1:PssKPKlqVIeyaed+0w492Xc2NgX5M3n6oZKOAj5rxoE= +git.wow.st/gmp/clip v0.0.0-20191001134149-1458ba6a7cf5 h1:OKeTjZST+/TKvtdA258NXJH+/gIx/xwyZxKrAezNFvk= +git.wow.st/gmp/clip v0.0.0-20191001134149-1458ba6a7cf5/go.mod h1:NLdpaBoMQNFqncwP8OVRNWUDw1Kt9XWm3snfT7cXu24= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/jcmdev0/gpgagent v0.0.0-20180509014935-5601b32d936c h1:DCnjNrPDSEslcqqBgcZBxlLUIhk2elQVyf2V+HkyxJI= diff --git a/impl_darwin.go b/impl_darwin.go index 0ac1cf1..708df3c 100644 --- a/impl_darwin.go +++ b/impl_darwin.go @@ -4,7 +4,6 @@ package passgo import ( "bufio" - "bytes" "encoding/hex" "fmt" "os" @@ -14,6 +13,8 @@ import ( "strconv" "strings" + "git.wow.st/gmp/clip" + "golang.org/x/crypto/openpgp" "github.com/jcmdev0/gpgagent" @@ -120,8 +121,5 @@ func init() { //Clip copies a string to the clipboard func Clip(x string) { - b := bytes.NewBuffer([]byte(x)) - cmd := exec.Command("pbcopy") - cmd.Stdin = b - cmd.Run() + clip.Set(x) }