Skip to content

Commit

Permalink
On linux provide global var Primary which allow to choose primary mode
Browse files Browse the repository at this point in the history
selection.
  • Loading branch information
uvelichitel committed Dec 5, 2017
1 parent bb272b8 commit 1234442
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions clipboard_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const (
)

var (
Primary bool

pasteCmdArgs []string
copyCmdArgs []string

Expand Down Expand Up @@ -48,10 +50,16 @@ func init() {
}

func getPasteCommand() *exec.Cmd {
if Primary {
pasteCmdArgs = pasteCmdArgs[:1]
}
return exec.Command(pasteCmdArgs[0], pasteCmdArgs[1:]...)
}

func getCopyCommand() *exec.Cmd {
if Primary {
copyCmdArgs = copyCmdArgs[:1]
}
return exec.Command(copyCmdArgs[0], copyCmdArgs[1:]...)
}

Expand Down

0 comments on commit 1234442

Please sign in to comment.