Skip to content

Commit

Permalink
Merge pull request #21 from uvelichitel/master
Browse files Browse the repository at this point in the history
On linux provide global var Primary which allow to choose primary mode
  • Loading branch information
atotto authored Dec 29, 2017
2 parents cbdd719 + 1234442 commit e5dffc8
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 e5dffc8

Please sign in to comment.