update copy/pase for wayland
This commit is contained in:
36
bin/copy
36
bin/copy
@@ -2,17 +2,31 @@
|
|||||||
set -e
|
set -e
|
||||||
set -u
|
set -u
|
||||||
|
|
||||||
if hash pbcopy 2>/dev/null; then
|
if [ $# -eq 0 ]; then
|
||||||
exec pbcopy
|
if hash pbcopy 2>/dev/null; then
|
||||||
elif hash xclip 2>/dev/null; then
|
exec pbcopy
|
||||||
exec xclip -selection clipboard
|
elif hash wl-copy 2>/dev/null; then
|
||||||
elif hash putclip 2>/dev/null; then
|
exec wl-copy
|
||||||
exec putclip
|
elif hash xclip 2>/dev/null; then
|
||||||
|
exec xclip -selection clipboard
|
||||||
|
elif hash putclip 2>/dev/null; then
|
||||||
|
exec putclip
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
rm -f /tmp/clipboard 2> /dev/null
|
if hash pbcopy 2>/dev/null; then
|
||||||
if [ $# -eq 0 ]; then
|
exec pbcopy < "$1"
|
||||||
cat > /tmp/clipboard
|
elif hash wl-copy 2>/dev/null; then
|
||||||
else
|
exec wl-copy < "$1"
|
||||||
cat "$1" > /tmp/clipboard
|
elif hash xclip 2>/dev/null; then
|
||||||
|
exec xclip -selection clipboard < "$1"
|
||||||
|
elif hash putclip 2>/dev/null; then
|
||||||
|
exec putclip < "$1"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -f /tmp/clipboard 2> /dev/null
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
cat > /tmp/clipboard
|
||||||
|
else
|
||||||
|
cat "$1" > /tmp/clipboard
|
||||||
|
fi
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ set -u
|
|||||||
|
|
||||||
if hash pbpaste 2>/dev/null; then
|
if hash pbpaste 2>/dev/null; then
|
||||||
exec pbpaste
|
exec pbpaste
|
||||||
|
elif hash wl-paste 2>/dev/null; then
|
||||||
|
exec wl-paste
|
||||||
elif hash xclip 2>/dev/null; then
|
elif hash xclip 2>/dev/null; then
|
||||||
exec xclip -selection clipboard -o
|
exec xclip -selection clipboard -o
|
||||||
elif [[ -e /tmp/clipboard ]]; then
|
elif [[ -e /tmp/clipboard ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user