.TH xcutsel "" "" "X Utility"
.PC "Copy text between the cut buffer and the primary selection"
\fBxcutsel [\-\fItoolkitoption ...\^\fB] [\-selection \fIselection\^\fB] [\-cutbuffer \fInumber\^\fB]\fR
.PP
.HS
.SH Options:
.IC "\fB\-bd \fIcolor\fR"
Set the color of the border to \fIcolor\fR
.IC "\fB\-bg \fIcolor\fR"
Set the color of the background to \fIcolor\fR
.IC "\fB\-bw \fIpixels\fR"
Set the width of the border to \fIpixels\fR
.IC "\fB\-cutbuffer \fInumber\fR"
Set the cut buffer to use
.IC "\fB\-display \fIhost\^\fB[:\fIserver\^\fB][.\fIscreen\^\fB]\fR"
Display the client's window on screen number \fIscreen\fR
of \fIserver\fR on host system \fIhost\fR
.IC "\fB\-fg \fIcolor\fR"
Set the color of the foreground to \fIcolor\fR
.IC "\fB\-fn \fIfont\fR"
Use \fIfont\fR in the display
.IC "\fB\-geometry \fIgeometry\fR"
Set the geometry of the program's window to \fIgeometry\fR
.IC \fB\-rv\fR
Simulate reverse video by exchanging the foreground and background colors
.IC "\fB\-selection \fIname\fR"
Set the name of the selection to use
.IC "\fB\-xrm \fIresourcestring\fR"
Use \fIresourcestring\fR to define a resource
.HE
.II "cut buffer"
.II "primary selection"
.II cut
.II paste
Prior to release 3 of the X Window System, text that you cut with the
mouse was copied into the system's cut buffer.
.II "primary selection"
Beginning with release 3, X added the
.I "primary selection"
\(em a special buffer that holds the text highlighted with the mouse.
.II PRIMARY
.II "property^PRIMARY"
(X stores the primary selection in the property
.BR PRIMARY .
You can use the utility
.B xprop
to to examine the contents of this property.)
Release 3 added the primary selection because some applications perform
transformations on the text kept in the cut buffer; it set aside the
primary selection to keep the ``raw'' text available for pasting into
other windows.
.PP
Thus, when you cut text, X copies the cut text into both the copy buffer
and the primary selection.
When you paste text, X copies the primary selection into the current window;
if the primary selection is empty for some reason, it copies the text that
is in the cut buffer.
.PP
This creates a problem, however, because
X applications written prior to release 3 use the cut buffer for cutting
and pasting, and do not understand the primary selection.
If you are cutting and pasting between release-2 and release-3 X applications,
the primary selection and the cut buffer can get out of step; and so when you
paste, you may not get the text that you expect.
To get around this problem, the \*(CO X release includes the X utility
.BR xcutsel ,
which copies text between the primary selection and the cut buffer.
When you invoke this application, it displays a window that shows the
following buttons:
.IP \fK(quit)\fR
Exit from
.BR xcutsel .
.B xcutsel
automatically releases all selections that it holds.
.IP "\fK(copy_PRIMARY_to_0)\fR"
Copy the primary selection into the cut buffer.
.IP "\fK(copy_0_to_PRIMARY)\fR"
Copy the cut buffer into the primary selection.
.PP
The button labels reflect the selection and cut buffer selected by
command line options or through the resource database.
By default,
.B xcutsel
uses the selection named
.B PRIMARY
and the cut buffer
.BR CUT_BUFFER0 .
You can override either or both of these by setting command-line arguments
or resources.
.PP
When you click the button
\fK(copy_0_to_PRIMARY)\fR, the button remains in reverse video as long as
.B cutsel
owns the selection, as a reminder.
The value of the selection remains constant:
if the cut buffer is changed, you must again activate the copy button
to retrieve the new value.
.SH Options
.B xcutsel
recognizes the following command-line options:
.IP "\fB\-bd \fIcolor\fR" 0.75i
Set the color of the border to
.IR color .
.IP "\fB\-bg \fIcolor\fR"
Set the color of the background to
.IR color .
.IP "\fB\-bw \fIpixels\fR"
Set the width of the border to
.IR pixels .
.IP "\fB\-cutbuffer \fInumber\fR"
Set the cut buffer to use.
The default is cut buffer 0.
.IP "\fB\-display \fIhost\^\fB[:\fIserver\^\fB][.\fIscreen\^\fB]\fR"
Display the client's window on screen number
.I screen
of
.I server
on host system
.IR host .
.IP "\fB\-fg \fIcolor\fR"
Set the color of the foreground to
.IR color .
.IP "\fB\-fn \fIfont\fR"
Use
.I font
in the display.
.IP "\fB\-geometry \fIgeometry\fR"
Set the geometry of the program's window to
.IR geometry .
The term ``geometry'' means the dimensions of the window and its location
on the screen.
.I geometry
has the form \fIwidth\(muheight\(+-xoffset\(+-yoffset\fR.
.IP \fB\-rv\fR
Simulate reverse video by exchanging the foreground and background colors.
.IP "\fB\-selection \fIname\fR"
Set the name of the selection to use.
The default is
.BR PRIMARY .
.IP "\fB\-xrm \fIresourcestring\fR"
Use
.I resourcestring
to define a resource.
.SH "X Defaults"
This program accepts all of the standard X Toolkit resource names and classes
as well as:
.IP "\fBselection (\fRclass\fB Selection)\fR"
Name the selection to use.
The default is
.BR PRIMARY .
.IP "\fBcutBuffer (\fRclass\fB CutBuffer)\fR"
Set the number of the cut buffer to use.
The default is Zero.
.SH "Widget Names"
Use the following instance names when you wish to configure their labels:
.IP "\fBsel-cut (\fRclass\fB Command)\fR"
This is the button \fK(copy_SELECTION_to_BUFFER)\fR.
.IP "\fBcut-sel (\fRclass\fB Command)\fR"
This is the button \fK(copy_BUFFER_to_SELECTION)\fR.
.IP "\fBquit (\fRclass\fB Command)\fR"
This is the button \fK(quit)\fR.
.SH "See Also"
.B
xclipboard,
xterm,
X utilities
.R
.SH Notes
All X applications shipped with the \*(CO release of X conform to X
release 3 or later.
Therefore, you should never need to use this utility.
You may need it, however, if you import antique X applications.
.PP
.B xcutsel
has no way by which you can change the name of the selection
or the number of the cut buffer while it is running.
.PP
Copyright \(co 1988, Massachusetts Institute of Technology.
.PP
.II "Swick, Ralph R."
.B xcutsel
was written by Ralph R. Swick of DEC/MIT Project Athena.
