3 # Copyright (C) 2016 Richard Burke, ISC licensed
11 vc_fatal
"`basename $0` [--usable|--copy|--paste]"
14 vc_determine_command
() {
15 if [ -n "$DISPLAY" ]; then
16 for c
in xclip xsel
; do
17 if type "$c" >/dev
/null
2>&1; then
22 elif type pbcopy
>/dev
/null
2>&1; then
25 elif [ -c /dev
/clipboard
]; then
34 if vc_determine_command
>/dev
/null
2>&1; then
42 COPY_CMD
="`vc_determine_command 2>/dev/null`"
44 if [ $?
-ne 0 ] ||
[ -z "$COPY_CMD" ]; then
45 vc_fatal
'System clipboard not supported'
54 PASTE_CMD
="`vc_determine_command 2>/dev/null`"
56 if [ $?
-ne 0 ] ||
[ -z "$PASTE_CMD" ]; then
57 vc_fatal
'System clipboard not supported'
74 xclip
-selection clipboard
-i >/dev
/null
2>&1
78 xclip
-selection clipboard
-o