| 1 |
root |
1.1 |
.TH XCB 1 "Oct 6 1994" "X Version 11" |
| 2 |
|
|
.SH NAME |
| 3 |
|
|
xcb \- X Cut Buffers \- Pigeon holes for your cut and paste selections. |
| 4 |
|
|
.SH SYNOPSIS |
| 5 |
|
|
.B xcb |
| 6 |
|
|
[\fIXt option\fP] |
| 7 |
|
|
[\fB\-l\fP \fIlayout\fP] |
| 8 |
|
|
[\fB\-n\fP \fIcount\fP] |
| 9 |
|
|
[\fB\-p\fP|\fB\-s\fP|\fB\-S\fP \fIlist\fP] |
| 10 |
|
|
[\fB\-r\fP \fIcount\fP] |
| 11 |
|
|
.SH DESCRIPTION |
| 12 |
|
|
\fIXcb\fP provides easy access to the cut buffers built into every X server. |
| 13 |
|
|
It allows the buffers to be manipulated either via the command line, |
| 14 |
|
|
or with the mouse in a point and click manner. |
| 15 |
|
|
The buffers can be used as holding pens to store and retrieve |
| 16 |
|
|
arbitrary data fragments. |
| 17 |
|
|
Any number of cut buffers may be created, |
| 18 |
|
|
so any number of different pieces of data can be saved and recalled later. |
| 19 |
|
|
By default, 8 cut buffers are created. |
| 20 |
|
|
The program is designed primarily for use with textual data. |
| 21 |
|
|
.LP |
| 22 |
|
|
\fIXcb\fP has two modes of operation. |
| 23 |
|
|
Normally \fIxcb\fP provides an array of windows on your display, |
| 24 |
|
|
one per cut buffer, tiled horizontally, vertically, or in some |
| 25 |
|
|
user specified layout. |
| 26 |
|
|
Each window displays the contents of its respective cut buffer. |
| 27 |
|
|
Data can be cut from and pasted to the windows in a similar manner |
| 28 |
|
|
to xterm. |
| 29 |
|
|
The buffers can also be rotated. |
| 30 |
|
|
.LP |
| 31 |
|
|
In task mode, \fIxcb\fP lets you access the cut buffers from the command line. |
| 32 |
|
|
Cut buffers can be loaded from stdin, |
| 33 |
|
|
copied or concatenated to stdout, |
| 34 |
|
|
loaded using the current PRIMARY selection, |
| 35 |
|
|
or rotated an arbitrary number of positions. |
| 36 |
|
|
In this mode of operation, \fIxcb\fP performs the requested task |
| 37 |
|
|
and then exits. |
| 38 |
|
|
It does not create any windows and |
| 39 |
|
|
has no interaction with the mouse or keyboard. |
| 40 |
|
|
.SH OPTIONS |
| 41 |
|
|
\fIXcb\fP supports the full set of X Toolkit Intrinsics options, |
| 42 |
|
|
as well as those listed below. |
| 43 |
|
|
\fIXcb\fP options can appear in any order. |
| 44 |
|
|
The presence of the |
| 45 |
|
|
\fB\-p\fP, |
| 46 |
|
|
\fB\-r\fP, |
| 47 |
|
|
\fB\-s\fP or |
| 48 |
|
|
\fB\-S\fP |
| 49 |
|
|
options causes \fIxcb\fP to execute in task mode, |
| 50 |
|
|
described above. |
| 51 |
|
|
.IP "\fB\-l\fP \fIlayout\fP" |
| 52 |
|
|
This option controls the geometry arrangement of \fIxcb's\fP subwindows. |
| 53 |
|
|
It is the command line equivalent of the \fB.layout\fP resource, |
| 54 |
|
|
described below. |
| 55 |
|
|
.LP |
| 56 |
|
|
.IP "\fB\-n\fP \fIcount\fP" |
| 57 |
|
|
Create \fIcount\fP cut buffers. |
| 58 |
|
|
\fICount\fP can be any integer greater than zero. |
| 59 |
|
|
This option is the command line equivalent of the \fB.bufferCount\fP |
| 60 |
|
|
resource, described below. |
| 61 |
|
|
.LP |
| 62 |
|
|
.IP "\fB\-u\fP" |
| 63 |
|
|
Use utf-8 instead of the current locale settings when executing in task mode |
| 64 |
|
|
and doing I/O. |
| 65 |
|
|
.LP |
| 66 |
|
|
.IP "\fB\-V\fP" |
| 67 |
|
|
Print the xcb release version number and exit immediately. |
| 68 |
|
|
.LP |
| 69 |
|
|
.IP "\fB\-p\fP \fIlist\fP" |
| 70 |
|
|
Print the contents of the listed buffer(s) on stdout. |
| 71 |
|
|
The buffered data is printed exactly as it is stored in the server. |
| 72 |
|
|
Selecting two or more buffers has the effect of concatenating |
| 73 |
|
|
the data on stdout. |
| 74 |
|
|
The cut buffers are numbered from 0... onwards. |
| 75 |
|
|
The list can be either a single digit, |
| 76 |
|
|
a comma separated list of digits, |
| 77 |
|
|
a range of the form m\-n, |
| 78 |
|
|
or some combination of lists and ranges. |
| 79 |
|
|
The buffers are printed in listed order, |
| 80 |
|
|
so repeated numbers in the list can be used to |
| 81 |
|
|
duplicate buffer contents. |
| 82 |
|
|
.LP |
| 83 |
|
|
.IP "\fB\-r\fP \fIcount\fP" |
| 84 |
|
|
Rotate the buffers by \fIcount\fP positions. |
| 85 |
|
|
\fICount\fP can be any integer, positive or negative. |
| 86 |
|
|
This option may be used in conjunction with the |
| 87 |
|
|
\fB\-n\fP \fIcount\fP option to rotate |
| 88 |
|
|
a specific number of buffers. |
| 89 |
|
|
If the \fB\-n\fP option is not used, \fIxcb\fP will rotate |
| 90 |
|
|
the number of buffers given by the \fB.bufferCount\fP resource. |
| 91 |
|
|
.LP |
| 92 |
|
|
.IP "\fB\-s\fP \fIlist\fP" |
| 93 |
|
|
Store the data from stdin in the listed buffer(s). |
| 94 |
|
|
If the list refers to two or more buffers, the input data is duplicated |
| 95 |
|
|
in each buffer. |
| 96 |
|
|
Refer to the \fB\-p\fP option for the definition of a list. |
| 97 |
|
|
.LP |
| 98 |
|
|
.IP "\fB\-S\fP \fIlist\fP" |
| 99 |
|
|
Store the current PRIMARY selection data in the listed buffer(s). |
| 100 |
|
|
The data is converted to a string representation. |
| 101 |
|
|
If the list refers to two or more buffers, the PRIMARY selection is |
| 102 |
|
|
duplicated in each buffer. |
| 103 |
|
|
Refer to the \fB\-p\fP option for the definition of a list. |
| 104 |
|
|
Under the \-S option xcb waits for the nominated cut buffer's contents |
| 105 |
|
|
to change before exiting. If no change is detected within |
| 106 |
|
|
3 seconds, xcb exits with a non-zero return code. |
| 107 |
|
|
.SH WIDGETS and RESOURCES |
| 108 |
|
|
The \fIxcb\fP widget hierarchy consists of a collection of |
| 109 |
|
|
custom buffer widgets, one per cut buffer. |
| 110 |
|
|
In the Athena version of the program, these buffer widgets are all |
| 111 |
|
|
contained within a single Athena form widget. |
| 112 |
|
|
In the Motif version of the program, they are |
| 113 |
|
|
each enclosed by Motif frame widgets, and the frame |
| 114 |
|
|
widgets are all contained within a single Motif RowColumn widget. |
| 115 |
|
|
.LP |
| 116 |
|
|
The names of the buffer widgets are "buffer0", "buffer1", |
| 117 |
|
|
"buffer2", .... etc., and their class name is "Buffer". |
| 118 |
|
|
Each buffer widget supports all the standard core widget |
| 119 |
|
|
resources, plus the \fB\.foreground\fP and \fB\.fontSet\fP resources. |
| 120 |
|
|
.LP |
| 121 |
|
|
Application wide resources are as follows: |
| 122 |
|
|
.br |
| 123 |
|
|
.sp 1 |
| 124 |
|
|
.nf |
| 125 |
|
|
\fB\.bufferCount\fP (default value 8) |
| 126 |
|
|
.in +8 |
| 127 |
|
|
This is the number of buffer widgets to create. |
| 128 |
|
|
Any number of widgets (greater than zero) can be created. |
| 129 |
|
|
.in -8 |
| 130 |
|
|
.sp 1 |
| 131 |
|
|
\fB\.layout\fP (default value "h") |
| 132 |
|
|
.in +8 |
| 133 |
|
|
Only the first character of the resource value is significant. |
| 134 |
|
|
This is the geometry arrangement to apply in the container widget. |
| 135 |
|
|
The layout can be "h" (horizontal), "v" (vertical), or some |
| 136 |
|
|
other value to disable the inbuilt geometry code and specify |
| 137 |
|
|
the layout via your X resources. An example is provided in the |
| 138 |
|
|
application default resources file. |
| 139 |
|
|
.in -8 |
| 140 |
|
|
.fi |
| 141 |
|
|
.SH EVENTS and TRANSLATIONS |
| 142 |
|
|
\fIXcb's\fP input semantics are coded into a Toolkit translation table. |
| 143 |
|
|
The default bindings have been chosen to conform with the default |
| 144 |
|
|
configuration of other cut and paste clients, such as xterm. |
| 145 |
|
|
The bindings may be altered or overridden according to your needs. |
| 146 |
|
|
The actions functions provided by \fIxcb\fP are:\- |
| 147 |
|
|
.br |
| 148 |
|
|
.sp 1 |
| 149 |
|
|
.ns |
| 150 |
|
|
.ta 16n |
| 151 |
|
|
.nf |
| 152 |
|
|
cut() causes the contents of the chosen cut buffer to become |
| 153 |
|
|
the PRIMARY selection. The window contents, if any, |
| 154 |
|
|
are highlighted, and can then be pasted into other |
| 155 |
|
|
cut buffers or applications. |
| 156 |
|
|
.sp 1 |
| 157 |
|
|
paste() causes the value of the PRIMARY selection to be |
| 158 |
|
|
converted into text and pasted into the chosen cut |
| 159 |
|
|
buffer, overwriting any previous buffer contents. |
| 160 |
|
|
If no PRIMARY selection is present, \fIxcb\fP pastes |
| 161 |
|
|
the contents of cut buffer zero into the chosen buffer. |
| 162 |
|
|
.sp 1 |
| 163 |
|
|
clear() clears the chosen cut buffer. |
| 164 |
|
|
.sp 1 |
| 165 |
|
|
rotate(NN) rotates the cut buffers by NN positions. NN may |
| 166 |
|
|
be any positive or negative number. |
| 167 |
|
|
.sp 1 |
| 168 |
|
|
refresh() causes the cut buffer window to be cleared and redrawn. |
| 169 |
|
|
.sp 1 |
| 170 |
|
|
selreq() this action function handles paste requests |
| 171 |
|
|
from other clients, or other \fIxcb\fP windows. |
| 172 |
|
|
It should always be bound to SelectionRequest events. |
| 173 |
|
|
.sp 1 |
| 174 |
|
|
selclear() this action function responds to the loss of |
| 175 |
|
|
ownership of the PRIMARY selection property. |
| 176 |
|
|
It should always be bound to SelectionClear events. |
| 177 |
|
|
.sp 1 |
| 178 |
|
|
quit() causes \fIxcb\fP to terminate. |
| 179 |
|
|
.fi |
| 180 |
|
|
.ta 8n |
| 181 |
|
|
.sp 1 |
| 182 |
|
|
The default bindings are as follows:\- |
| 183 |
|
|
.sp 1 |
| 184 |
|
|
.ta 20n |
| 185 |
|
|
.nf |
| 186 |
|
|
<Btn1Down>: cut() \\n\\ |
| 187 |
|
|
Shift <Btn2Down>: clear() \\n\\ |
| 188 |
|
|
<Btn2Down>: paste() \\n\\ |
| 189 |
|
|
Shift <Btn3Down>: rotate(-1) \\n\\ |
| 190 |
|
|
<Btn3Down>: rotate(1) \\n\\ |
| 191 |
|
|
<Key>Left: rotate(-1) \\n\\ |
| 192 |
|
|
<Key>Right: rotate(1) \\n\\ |
| 193 |
|
|
<Key>Up: rotate(-1) \\n\\ |
| 194 |
|
|
<Key>Down: rotate(1) \\n\\ |
| 195 |
|
|
<Key>q: quit() \\n\\ |
| 196 |
|
|
<SelReq>: selreq() \\n\\ |
| 197 |
|
|
<SelClr>: selclear() |
| 198 |
|
|
.fi |
| 199 |
|
|
.ta 8n |
| 200 |
|
|
.sp 1 |
| 201 |
|
|
.SH EXAMPLES |
| 202 |
|
|
The following are some examples of \fIxcb\fP task mode usage:\- |
| 203 |
|
|
.sp 1 |
| 204 |
|
|
xcb \-s 0\-7 < /dev/null |
| 205 |
|
|
.br |
| 206 |
|
|
This clears the first 8 cut buffers in your server. |
| 207 |
|
|
.sp 1 |
| 208 |
|
|
echo "G'day." | xcb \-display bigears:0.0 \-s 1,3,5,7 |
| 209 |
|
|
.br |
| 210 |
|
|
This loads the string "G'day." into four of the cut buffers |
| 211 |
|
|
on the display "bigears". |
| 212 |
|
|
.sp 1 |
| 213 |
|
|
xsendevent -win buffer5 '<Btn1Down>' |
| 214 |
|
|
.br |
| 215 |
|
|
This uses the program xsendevent to send a synthetic mouse click event |
| 216 |
|
|
to an xcb subwindow, thereby making that window the owner of |
| 217 |
|
|
the PRIMARY selection. |
| 218 |
|
|
.sp 1 |
| 219 |
|
|
ls \`xcb \-p 2,3\` |
| 220 |
|
|
.br |
| 221 |
|
|
This produces a listing of all the files named in |
| 222 |
|
|
cut buffers 2 and 3. |
| 223 |
|
|
.br |
| 224 |
|
|
.sp 1 |
| 225 |
|
|
xcb \-p 0\-7 | xcb \-s 0 |
| 226 |
|
|
.br |
| 227 |
|
|
This concatenates the values in the first 8 cut buffers, and places |
| 228 |
|
|
the result back in cut buffer zero. |
| 229 |
|
|
.sp 1 |
| 230 |
|
|
xcb -S 0 && xcb -p 0 |
| 231 |
|
|
.br |
| 232 |
|
|
The first command copies the current PRIMARY selection |
| 233 |
|
|
into the first cut buffer. If the copy succeeds, then |
| 234 |
|
|
the second command prints that data on stdout. |
| 235 |
|
|
.br |
| 236 |
|
|
.sp 1 |
| 237 |
|
|
.nf |
| 238 |
|
|
for i in 0 1 2 3 4 5 6 7 |
| 239 |
|
|
do |
| 240 |
|
|
xcb \-p $i > $HOME/.xcb/$i |
| 241 |
|
|
done |
| 242 |
|
|
for i in 0 1 2 3 4 5 6 7 |
| 243 |
|
|
do |
| 244 |
|
|
xcb \-s $i < $HOME/.xcb/$i |
| 245 |
|
|
done |
| 246 |
|
|
.fi |
| 247 |
|
|
This first loop saves the contents of each of the cut buffers |
| 248 |
|
|
in a separate file under your home directory. The second loop |
| 249 |
|
|
restores the cut buffer contents from those files. |
| 250 |
|
|
When placed in your .logout and .login scripts respectively, |
| 251 |
|
|
the commands are a simple method of preserving your cut buffers |
| 252 |
|
|
across login sessions. |
| 253 |
|
|
.sp 1 |
| 254 |
|
|
.nf |
| 255 |
|
|
function g { |
| 256 |
|
|
echo "$1\\\\c" | xcb \-s 7 |
| 257 |
|
|
grep "$@" |
| 258 |
|
|
} |
| 259 |
|
|
function vg { |
| 260 |
|
|
vi +/\`xcb \-p 7\` "$@" |
| 261 |
|
|
} |
| 262 |
|
|
.fi |
| 263 |
|
|
These two shell functions exemplify a simple mechanism for saving and |
| 264 |
|
|
reusing regular expressions. |
| 265 |
|
|
The first function saves the regex used for grep\-ing into |
| 266 |
|
|
cut buffer 7. The second function reuses the most recent |
| 267 |
|
|
grep regex as a search command in vi. |
| 268 |
|
|
There is considerable scope for expanding and improving these ideas. |
| 269 |
|
|
.SH SEE ALSO |
| 270 |
|
|
xterm(1), xcutsel(1), xclipboard(1), xprop(1) |
| 271 |
|
|
.br |
| 272 |
|
|
Athena Widget Set \- C Language Interface |
| 273 |
|
|
.br |
| 274 |
|
|
Motif Programmers Reference Guide |
| 275 |
|
|
.SH AUTHORS |
| 276 |
|
|
Current Maintainer (I18n version) |
| 277 |
|
|
.br |
| 278 |
|
|
Marc Lehmann |
| 279 |
|
|
.br |
| 280 |
|
|
E\-mail: pcg\@goof.com |
| 281 |
|
|
.br |
| 282 |
|
|
.sp 1 |
| 283 |
|
|
Original Author |
| 284 |
|
|
.br |
| 285 |
|
|
Farrell McKay |
| 286 |
|
|
.br |
| 287 |
|
|
E\-mail: Farrell.McKay\@mpx.com.au |
| 288 |
|
|
.br |
| 289 |
|
|
.sp 1 |
| 290 |
|
|
XView modifications provided by Danny Vanderryn |
| 291 |
|
|
.br |
| 292 |
|
|
E\-mail: dvanderr\@us.oracle.com |
| 293 |
|
|
.SH COPYRIGHT |
| 294 |
|
|
Copyright (C) 1992,1993,1994 by Farrell McKay. |
| 295 |
|
|
.br |
| 296 |
|
|
.sp 1 |
| 297 |
|
|
Permission to use, copy, modify, and distribute this software and its |
| 298 |
|
|
documentation for any purpose and without fee is hereby granted, provided |
| 299 |
|
|
that the above copyright notice appears in all copies and that both that |
| 300 |
|
|
copyright notice and this permission notice appear in supporting |
| 301 |
|
|
documentation. This software is provided "as is" without express or |
| 302 |
|
|
implied warranty. |
| 303 |
|
|
.SH "BUGS :\-)" |
| 304 |
|
|
Xlib's underlying protocol for moving selection data |
| 305 |
|
|
between client and server can sometimes be slow, |
| 306 |
|
|
depending on the amount of data involved. |
| 307 |
|
|
Do not expect fast performance if your selections are |
| 308 |
|
|
big or you want to store big files in your cut buffers! |
| 309 |
|
|
("big" means, say, over 10k bytes \- but your mileage |
| 310 |
|
|
may vary). |