xsel.1x (4561B)
1.TH XSEL 1x "January 2008" 2.SH NAME 3xsel \- manipulate the X selection. 4.SH SYNOPSIS 5.B xsel 6[\fIOPTION\fR]... 7.SH DESCRIPTION 8.PP 9Retrieve and set the X selection. 10.PP 11The X server maintains three selections, called \fIPRIMARY\fR, 12\fISECONDARY\fR and \fICLIPBOARD\fR. The PRIMARY selection is conventionally 13used to implement copying and pasting via the middle mouse button. The 14SECONDARY and CLIPBOARD selections are less frequently used by application 15programs. This program operates on the PRIMARY selection unless otherwise 16specified. 17.PP 18By default, this program outputs the selection without modification if both 19standard input and standard output are terminals (ttys). Otherwise, the 20current selection is output if standard output is not a terminal 21(tty), and the selection is set from standard input if standard input 22is not a terminal (tty). If any input or output options are given then 23the program behaves only in the requested mode. 24.PP 25If both input and output is required then the previous selection is 26output before being replaced by the contents of standard input. 27 28.PP 29\fBInput options\fR 30.TP 31\fB\-a\fR, \fB\-\-append\fR 32append standard input to the selection. Implies \fB\-i\fR. 33.TP 34\fB\-f\fR, \fB\-\-follow\fR 35append to selection as standard input grows. Implies \fB\-i\fR. 36.TP 37\fB\-i\fR, \fB\-\-input\fR 38read standard input into the selection. 39 40.PP 41\fBOutput options\fR 42.TP 43\fB\-o\fR, \fB\-\-output\fR 44write the selection to standard output. 45 46.PP 47\fBAction options\fR 48.TP 49\fB\-c\fR, \fB\-\-clear\fR 50clear the selection. Overrides all \fIinput\fR options. 51.TP 52\fB\-d\fR, \fB\-\-delete\fR 53Request that the current selection be deleted. This not only clears the 54selection, but also requests to the program in which the selection 55resides that the selected contents be deleted. Overrides all \fIinput\fR 56options. 57 58.PP 59\fBSelection options\fR 60.TP 61\fB\-p\fR, \fB\-\-primary\fR 62operate on the PRIMARY selection (default). 63.TP 64\fB\-s\fR, \fB\-\-secondary\fR 65operate on the SECONDARY selection. 66.TP 67\fB\-b\fR, \fB\-\-clipboard\fR 68operate on the CLIPBOARD selection. 69 70.TP 71\fB\-k\fR, \fB\-\-keep\fR 72Do not modify the selections, but make the PRIMARY and SECONDARY selections 73persist even after the programs they were selected in exit. (Conventionally, 74the CLIPBOARD selection is persisted by a separate special purpose program 75such as \fIxclipboard(1)\fR). Ignores all \fIinput\fR and \fIoutput\fR 76options. 77.TP 78\fB\-x\fR, \fB\-\-exchange\fR 79exchange the PRIMARY and SECONDARY selections. Ignores all \fIinput\fR 80and \fIoutput\fR options. 81 82.PP 83\fBX options\fR 84.TP 85\fB\-\-display\fR \fIdisplayname\fR 86specify the server to use; see \fIX(1)\fP. 87.TP 88\fB\-\-windowName\fR \fIwindowName\fR 89specify the X WM_NAME window property; default is "xsel". 90.TP 91\fB\-t\fR \fIms\fR, \fB\-\-selectionTimeout\fR \fIms\fR 92Specify the timeout in milliseconds within which the selection must be 93retrieved. In \fB\-\-input\fR mode, the background process exits after this 94amount of time. A value of \fB0\fR (zero) specifies no timeout (default). 95 96.PP 97\fBMiscellaneous options\fR 98.TP 99\fB\-l\fR \fIfilename\fR, \fB\-\-logfile\fR \fIfilename\fR 100Specify the file to log errors to when detached. (Default 101\fI$HOME/.xsel.log\fR) 102.TP 103\fB\-n\fR, \fB\-\-nodetach\fR 104Do not detach from the controlling terminal. Without this option, xsel will 105fork to become a background process in \fIinput\fR, \fIexchange\fR and 106\fIkeep\fR modes. 107.TP 108\fB\-h\fR, \fB\-\-help\fR 109display usage information and exit 110.TP 111\fB\-v\fR, \fB\-\-verbose\fR 112Print informative messages. Additional instances of \fI\-v\fR raise the 113debugging level, ie. print more information. 114.TP 115\fB\-\-version\fR 116output version information and exit 117.PP 118.SH NOTES 119.PP 120\fIThere is no X selection buffer.\fR The selection mechanism in X11 is 121an interclient communication mediated by the X server each time any 122program wishes to know the selection contents, eg. to perform a middle 123mouse button paste. In order to implement modification of the selection(s) 124(in \fIinput\fR, \fIkeep\fR and \fIexchange\fR modes) this program detaches 125from the terminal, spawning a child process to supply the new selection(s) 126on demand. This child exits immediately when any other program takes over 127the selection(s), eg. when the user next selects some text in a terminal 128window or by running \fBxsel \-c\fR. 129.PP 130.SH STANDARDS 131xsel conforms to the Inter\-Client Communication Conventions Manual 132Version 2.0 (ICCCM2). 133.PP 134.SH "SEE ALSO" 135X(7), Xserver(1), xset(1), xclipboard(1), xpaste(1) 136.PP 137.SH AUTHOR 138Conrad Parker <conrad@vergenet.net>, July 2001