update copy/pase for wayland

This commit is contained in:
2026-03-16 10:27:10 +01:00
parent 145f21eae7
commit 7342d94520
2 changed files with 27 additions and 11 deletions

View File

@@ -2,17 +2,31 @@
set -e set -e
set -u set -u
if hash pbcopy 2>/dev/null; then if [ $# -eq 0 ]; then
if hash pbcopy 2>/dev/null; then
exec pbcopy exec pbcopy
elif hash xclip 2>/dev/null; then elif hash wl-copy 2>/dev/null; then
exec wl-copy
elif hash xclip 2>/dev/null; then
exec xclip -selection clipboard exec xclip -selection clipboard
elif hash putclip 2>/dev/null; then elif hash putclip 2>/dev/null; then
exec putclip 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

View File

@@ -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