mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 05:11:06 +02:00
clipboard copy: add Linux/Wayland support
This commit is contained in:
parent
10bd3b47e9
commit
1adf845284
1 changed files with 5 additions and 1 deletions
|
@ -2133,7 +2133,11 @@ func copyToClipboard(str string) {
|
||||||
case "darwin":
|
case "darwin":
|
||||||
cmd = exec.Command("pbcopy")
|
cmd = exec.Command("pbcopy")
|
||||||
case "linux":
|
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:
|
default:
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue