Skip to content

Commit

Permalink
clipboard copy: add Linux/Wayland support
Browse files Browse the repository at this point in the history
  • Loading branch information
bitraid committed Oct 12, 2024
1 parent 10bd3b4 commit 1adf845
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/croc/croc.go
Original file line number Diff line number Diff line change
Expand Up @@ -2133,7 +2133,11 @@ func copyToClipboard(str string) {
case "darwin":
cmd = exec.Command("pbcopy")
case "linux":
cmd = exec.Command("xclip", "-selection", "clipboard")
if os.Getenv("XDG_SESSION_TYPE") == "wayland" {
cmd = exec.Command("wl-copy")
} else {
cmd = exec.Command("xclip", "-selection", "clipboard")
}
default:
return
}
Expand Down

0 comments on commit 1adf845

Please sign in to comment.