mirror of
https://github.com/schollz/croc.git
synced 2025-10-10 21:01:02 +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":
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue