Skip to content

Commit 63d4836

Browse files
committed
clipboard: add support for wayclip
1 parent 0034329 commit 63d4836

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/croc/croc.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2146,10 +2146,14 @@ func copyToClipboard(str string) {
21462146
// MacOS uses pbcopy
21472147
case "darwin":
21482148
cmd = exec.Command("pbcopy")
2149-
// These Unix-like systems are likely using Xorg(with xclip or xsel) or Wayland(with wl-copy)
2149+
// These Unix-like systems are likely using Xorg(with xclip or xsel) or Wayland(with wl-copy or waycopy)
21502150
case "linux", "hurd", "freebsd", "openbsd", "netbsd", "dragonfly", "solaris", "illumos", "plan9":
21512151
if os.Getenv("XDG_SESSION_TYPE") == "wayland" { // Wayland running
2152-
cmd = exec.Command("wl-copy")
2152+
if isExecutableInPath("wl-copy") {
2153+
cmd = exec.Command("wl-copy")
2154+
} else if isExecutableInPath("waycopy") {
2155+
cmd = exec.Command("waycopy")
2156+
}
21532157
} else if os.Getenv("XDG_SESSION_TYPE") == "x11" || os.Getenv("XDG_SESSION_TYPE") == "xorg" { // Xorg running
21542158
if isExecutableInPath("xclip") {
21552159
cmd = exec.Command("xclip", "-selection", "clipboard")

0 commit comments

Comments
 (0)