1
1
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

clipboard copy: add Linux/Wayland support

This commit is contained in:
bitraid 2024-10-12 14:53:48 +03:00
parent 10bd3b47e9
commit 1adf845284
No known key found for this signature in database
GPG key ID: 21A3B0D950B23728

View file

@ -2133,7 +2133,11 @@ func copyToClipboard(str string) {
case "darwin": case "darwin":
cmd = exec.Command("pbcopy") cmd = exec.Command("pbcopy")
case "linux": case "linux":
if os.Getenv("XDG_SESSION_TYPE") == "wayland" {
cmd = exec.Command("wl-copy")
} else {
cmd = exec.Command("xclip", "-selection", "clipboard") cmd = exec.Command("xclip", "-selection", "clipboard")
}
default: default:
return return
} }