diff --git a/extcmds.go b/system/extcmds.go similarity index 93% rename from extcmds.go rename to system/extcmds.go index 6767791..241c863 100644 --- a/extcmds.go +++ b/system/extcmds.go @@ -4,7 +4,7 @@ // +build !darwin,!android,!windows -package termshark +package system var CopyToClipboard = []string{"xsel", "-i", "-b"} diff --git a/extcmds_android.go b/system/extcmds_android.go similarity index 94% rename from extcmds_android.go rename to system/extcmds_android.go index 27adba9..6093b21 100644 --- a/extcmds_android.go +++ b/system/extcmds_android.go @@ -2,7 +2,7 @@ // code is governed by the MIT license that can be found in the LICENSE // file. -package termshark +package system var CopyToClipboard = []string{"termux-clipboard-set"} diff --git a/extcmds_darwin.go b/system/extcmds_darwin.go similarity index 92% rename from extcmds_darwin.go rename to system/extcmds_darwin.go index 01d2f06..93101b9 100644 --- a/extcmds_darwin.go +++ b/system/extcmds_darwin.go @@ -2,7 +2,7 @@ // code is governed by the MIT license that can be found in the LICENSE // file. -package termshark +package system var CopyToClipboard = []string{"pbcopy"} diff --git a/extcmds_windows.go b/system/extcmds_windows.go similarity index 92% rename from extcmds_windows.go rename to system/extcmds_windows.go index 2c1485e..fe9d726 100644 --- a/extcmds_windows.go +++ b/system/extcmds_windows.go @@ -2,7 +2,7 @@ // code is governed by the MIT license that can be found in the LICENSE // file. -package termshark +package system var CopyToClipboard = []string{"clip"} diff --git a/ui/ui.go b/ui/ui.go index 302625b..6a6fbdd 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -751,7 +751,7 @@ func openCopyChoices(copyLen int, app gowid.IApp) { copyCmd := termshark.ConfStringSlice( "main.copy-command", - termshark.CopyToClipboard, + system.CopyToClipboard, ) if len(copyCmd) == 0 { diff --git a/utils.go b/utils.go index 3d39e30..97c90cc 100644 --- a/utils.go +++ b/utils.go @@ -32,6 +32,7 @@ import ( "github.com/blang/semver" "github.com/gcla/gowid" "github.com/gcla/gowid/gwutil" + "github.com/gcla/termshark/system" "github.com/gcla/termshark/widgets/resizable" "github.com/mattn/go-isatty" "github.com/pkg/errors" @@ -795,7 +796,7 @@ func ApplyArguments(cmd []string, args []string) ([]string, int) { func BrowseUrl(url string) error { urlCmd := ConfStringSlice( "main.browse-command", - OpenURL, + system.OpenURL, ) if len(urlCmd) == 0 { @@ -843,7 +844,7 @@ func CopyCommand(input io.Reader, cb interface{}) error { copyCmd := ConfStringSlice( "main.copy-command", - CopyToClipboard, + system.CopyToClipboard, ) if len(copyCmd) == 0 {