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
24 if type pbcopy
>/dev
/null
2>&1; then
29 if [ -c /dev
/clipboard
]; then
38 if vc_determine_command
>/dev
/null
2>&1; then
46 COPY_CMD
="`vc_determine_command 2>/dev/null`"
48 if [ $?
-ne 0 ] ||
[ -z "$COPY_CMD" ]; then
49 vc_fatal
'System clipboard not supported'
58 PASTE_CMD
="`vc_determine_command 2>/dev/null`"
60 if [ $?
-ne 0 ] ||
[ -z "$PASTE_CMD" ]; then
61 vc_fatal
'System clipboard not supported'
78 xclip
-selection clipboard
-i >/dev
/null
2>&1
82 xclip
-selection clipboard
-o
102 --usable) vc_usable
;;