Files
infra/dotfiles/desktop/.tmux/bin/copy-to-clipboard
2026-07-27 23:08:57 +02:00

27 lines
475 B
Bash
Executable File

#!/bin/sh
set -eu
if command -v wl-copy >/dev/null 2>&1 && [ -n "${WAYLAND_DISPLAY:-}" ]; then
exec wl-copy
fi
if command -v xclip >/dev/null 2>&1 && [ -n "${DISPLAY:-}" ]; then
exec xclip -selection clipboard -in
fi
if command -v xsel >/dev/null 2>&1 && [ -n "${DISPLAY:-}" ]; then
exec xsel --clipboard --input
fi
if command -v clip.exe >/dev/null 2>&1; then
exec clip.exe
fi
if command -v pbcopy >/dev/null 2>&1; then
exec pbcopy
fi
cat >/dev/null
exit 1