vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
vis-clipboard.1
(2286B)
1 .Dd November 29, 2016
2 .Dt VIS-CLIPBOARD 1
3 .Os Vis VERSION
4 .
5 .Sh NAME
6 .Nm vis-clipboard
7 .Nd Read from or write to the system clipboard
8 .
9 .Sh SYNOPSIS
10 .Nm vis-clipboard
11 .Fl -usable
12 .Pp
13 .Nm vis-clipboard
14 .Fl -copy
15 .Op Fl -selection Ar selection
16 .Pp
17 .Nm vis-clipboard
18 .Fl -paste
19 .Op Fl -selection Ar selection
20 .
21 .Sh DESCRIPTION
22 .Nm vis-clipboard
23 wraps various system-specific tools for interacting with a system clipboard,
24 like
25 .Xr xsel 1
26 for X11,
27 .Xr pbcopy 1
28 for Mac OS X,
29 and
30 .Pa /dev/clipboard
31 on Cygwin.
32 .Pp
33 .Nm vis-clipboard
34 can run in three different ways,
35 depending on the flag given on the command-line.
36 .Bl -tag -width flag
37 .It Fl -usable
38 In this mode,
39 .Nm vis-clipboard
40 looks for a way to interface with the system clipboard.
41 If it finds one,
42 it terminates with exit code 0.
43 If no interface to the system clipboard is available,
44 it terminates with exit code 1.
45 .It Fl -copy
46 In this mode,
47 .Nm vis-clipboard
48 reads the content of standard input,
49 and stores it in the system clipboard.
50 .It Fl -paste
51 In this mode,
52 .Nm vis-clipboard
53 reads the content of the system clipboard,
54 and writes it to standard output.
55 .It Fl -selection Ar selection
56 specify which selection to use, options are "primary" or
57 "clipboard". Silently ignored on platforms with a single clipboard.
58 .El
59 .
60 .Sh ENVIRONMENT
61 The following environment variables affect the operation of
62 .Nm vis-clipboard :
63 .Bl -tag -width Ev
64 .It Ev DISPLAY
65 If non-empty,
66 .Nm vis-clipboard
67 will prefer to access the X11 clipboard even if other options are available.
68 .El
69 .
70 .Sh EXIT STATUS
71 .Ex -std vis-clipboard
72 .
73 When run with the
74 .Fl -usable
75 flag,
76 an exit status of 0 means that it found a supported system-specific tool,
77 while 1 means that clipboard access is not available.
78 .
79 .Sh EXAMPLES
80 Test whether clipboard access is available:
81 .Bd -literal -offset indent
82 if vis-clipboard --usable; then
83 echo "Clipboard access available"
84 else
85 echo "No clipboard"
86 fi
87 .Ed
88 .Pp
89 Copy a friendly greeting to the clipboard:
90 .Bd -literal -offset indent
91 echo "Hello, World" | vis-clipboard --copy
92 .Ed
93 .Pp
94 Send the current contents of the system clipboard to be recorded and analyzed:
95 .Bd -literal -offset indent
96 vis-clipboard --paste | curl -d - https://www.nsa.gov/
97 .Ed
98 .
99 .Sh SEE ALSO
100 .Xr pbcopy 1 ,
101 .Xr pbpaste 1 ,
102 .Xr vis 1 ,
103 .Xr xclip 1 ,
104 .Xr xsel 1