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 -u
if [ $# -eq 0 ]; then
if hash pbcopy 2>/dev/null; then
exec pbcopy
elif hash wl-copy 2>/dev/null; then
exec wl-copy
elif hash xclip 2>/dev/null; then
exec xclip -selection clipboard
elif hash putclip 2>/dev/null; then
exec putclip
fi
else
if hash pbcopy 2>/dev/null; then
exec pbcopy < "$1"
elif hash wl-copy 2>/dev/null; then
exec wl-copy < "$1"
elif hash xclip 2>/dev/null; then
exec xclip -selection clipboard < "$1"
elif hash putclip 2>/dev/null; then
exec putclip < "$1"
fi
fi
rm -f /tmp/clipboard 2> /dev/null
if [ $# -eq 0 ]; then
cat > /tmp/clipboard
else
cat "$1" > /tmp/clipboard
fi
fi

View File

@@ -4,6 +4,8 @@ set -u
if hash pbpaste 2>/dev/null; then
exec pbpaste
elif hash wl-paste 2>/dev/null; then
exec wl-paste
elif hash xclip 2>/dev/null; then
exec xclip -selection clipboard -o
elif [[ -e /tmp/clipboard ]]; then