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