Convert to git.wow.st/gmp/clip for Darwin clipboard.

This commit is contained in:
Greg 2019-10-01 13:54:35 -04:00
parent 5402aba41b
commit bf1709dc4c
3 changed files with 6 additions and 5 deletions

1
go.mod
View File

@ -4,6 +4,7 @@ go 1.12
require ( require (
gioui.org/ui v0.0.0-20190918172808-816f0e901fc6 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/fsnotify/fsnotify v1.4.7
github.com/jcmdev0/gpgagent v0.0.0-20180509014935-5601b32d936c github.com/jcmdev0/gpgagent v0.0.0-20180509014935-5601b32d936c
golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7 golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7

2
go.sum
View File

@ -1,5 +1,7 @@
gioui.org/ui v0.0.0-20190918172808-816f0e901fc6 h1:LvHEYxyOW7g+PhOiAm8Delc3AUv9EH219oDvaUMeKBw= gioui.org/ui v0.0.0-20190918172808-816f0e901fc6 h1:LvHEYxyOW7g+PhOiAm8Delc3AUv9EH219oDvaUMeKBw=
gioui.org/ui v0.0.0-20190918172808-816f0e901fc6/go.mod h1:PssKPKlqVIeyaed+0w492Xc2NgX5M3n6oZKOAj5rxoE= 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 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= 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= github.com/jcmdev0/gpgagent v0.0.0-20180509014935-5601b32d936c h1:DCnjNrPDSEslcqqBgcZBxlLUIhk2elQVyf2V+HkyxJI=

View File

@ -4,7 +4,6 @@ package passgo
import ( import (
"bufio" "bufio"
"bytes"
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"os" "os"
@ -14,6 +13,8 @@ import (
"strconv" "strconv"
"strings" "strings"
"git.wow.st/gmp/clip"
"golang.org/x/crypto/openpgp" "golang.org/x/crypto/openpgp"
"github.com/jcmdev0/gpgagent" "github.com/jcmdev0/gpgagent"
@ -120,8 +121,5 @@ func init() {
//Clip copies a string to the clipboard //Clip copies a string to the clipboard
func Clip(x string) { func Clip(x string) {
b := bytes.NewBuffer([]byte(x)) clip.Set(x)
cmd := exec.Command("pbcopy")
cmd.Stdin = b
cmd.Run()
} }