We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e7fbf5 commit a257dd9Copy full SHA for a257dd9
scripts/pb
@@ -26,7 +26,18 @@ _verbose() {
26
}
27
28
_clip() {
29
- echo "$@" | xclip -selection clipboard
+ if [ -x "$(command -v pbcopy)" ]; then
30
+ echo "$@" | pbcopy
31
+ elif [ -x "$(command -v xclip)" ]; then
32
+ echo "$@" | xclip -selection clipboard
33
+ elif [ -x "$(command -v xsel)" ]; then
34
+ echo "$@" | xsel -b
35
+ elif [ -x "$(command -v wl-copy)" ]; then
36
+ echo "$@" | wl-copy
37
+ else
38
+ _verbose "Cannot find a clipboard tool. Requires one of 'pbcopy' (macOS), 'xclip' (xorg), 'xsel' (xorg) or 'wl-copy' (wayland)."
39
+ return
40
+ fi
41
_verbose "'$*' is copied to your clipboard"
42
43
0 commit comments