#!/usr/bin/env sh

can() {
  command -v "$1" >/dev/null
  return $?
}

if can wl-copy; then
  WAYLAND_DISPLAY=wayland-0 wl-copy --trim-newline
elif can pbcopy; then
  pbcopy
elif can xclip; then
  xclip -selection clipboard
elif can copy.exe; then
  echo COPYEXE
else
  echo "No copier found!"
  exit 1
fi
