1 2 3 4 5 6
#!/bin/sh [ "$1" = "-p" ] && arg='primary' if [ "$WAYLAND_DISPLAY" ] then wl-copy -n $1 else xclip -selection "${arg:-clipboard}" -r fi