Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 169 lines (100 sloc) 4.496 kB
229b174 update to 0.9.6 sources (full tarball); conversion from Imake to GNU …
conrad authored
1 XSel -- manipulate the X selection.
2
3 Copyright (C) 2001 Conrad Parker <conrad@vergenet.net>
4
5 For updates see http://www.vergenet.net/~conrad/software/xsel/
6
7
8 INTRODUCTION
9 ============
10
11 XSel is a command-line program for getting and setting the contents of the
12 X selection. Normally this is only accessible by manually highlighting
13 information and pasting it with the middle mouse button.
14
15
16 To read a file into the X selection:
17 ------------------------------------
18
19 xsel < file
20
21 after which you can paste the file's contents into any X application with
22 the middle mouse button, as though you had highlighted its text. XSel will
23 read in the file contents exactly, whereas manual highlighting invariably
24 breaks lines and transforms tabs into spaces. This is especially handy for
25 copying in large files.
26
27
28 To write the X selection to a file:
29 -----------------------------------
30
31 xsel > file
32
33 after which file will contain exactly the contents of the X selection,
34 without trailing newlines and spaces and crap.
35
36
37 XSel is more than just cat for the X selection.
38
39
40 Append to the X selection:
41 --------------------------
42
43 xsel --append < file
44
45
46 To follow a growing file:
47 -------------------------
48
49 xsel --follow < file
50
51 to make the X selection follow standard input as it grows (like tail -f).
52
53
54 ADVANCED FEATURES
55 =================
56
57 XSel also lets you access some of the more esoteric features of the
58 X selection:
59
60
61 Delete the contents of the selection
62 ------------------------------------
63
64 xsel --delete
65
66 Will cause the program in which text is selected to delete that text. This
67 really works, you can try it on xedit to remotely delete text in the editor
68 window.
69
70
71 Manipulate the secondary selection
72 ----------------------------------
73
74 The X Window System maintains two selections, the usual primary selection
75 and a secondary, which isn't used much ... XSel lets you use the secondary
76 selection, for example:
77
78 To get and set the secondary selection:
79 ---------------------------------------
80
81 xsel --secondary < file
82 xsel --secondary > file
83
84 To swap the primary and secondary selections:
85 ---------------------------------------------
86 xsel --exchange
87
88 So for example you can store useful text in the secondary selection and
89 retrieve it later.
90
91
92 Manipulate the clipboard selection
93 ----------------------------------
94
95 Similarly, X has a clipboard selection. You can use the standard xclipboard
96 program to manage a history of selected text, and you can use xsel to
97 actually get text into that clipboard:
98
99 xsel --clipboard < file
100
101
102 Make the selection contents persist in memory
103 ---------------------------------------------
104
105 Normally the X selection only exists as long as the program it was selected
106 in is running. Further, some buggy applications tend to forget their
107 selection text after a little while. If you run:
108
109 xsel --keep
110
111 after selecting some important text, xsel will copy the text into its own
112 memory so you can paste it elsewhere even if the original program exits or crashes.
113
114
115 Further information
116 ===================
117
118 Naturally all these options have single character equivalents, and
119
120 xsel --help
121
122 provides usage information. For complete details, see the xsel(1x) man page.
123
124
125 DOWNLOAD
126 ========
127
128 New versions of XSel are distributed in source form from:
129
130 http://www.vergenet.net/~conrad/software/xsel/
131
132
133 STANDARDS
134 =========
135
136 X11 ICCCM2
137 ----------
138
139 XSel conforms to the X Window System Inter-Client Communication Conventions
140 Manual Version 2.0 (ICCCM2), including correct handling of TARGETS,
141 MULTIPLE, TIMESTAMP, and DELETE targets, INCR properties and large data
142 transfers.
143
144 My thoughts on ICCCM are available at:
145
146 http://lists.slug.org.au/archives/slug-chat/2001/July/msg00054.html
147
148 (Warning: explicit language).
149
150
151 LICENSE
152 =======
153
154 Copyright (C) 2001 Conrad Parker <conrad@vergenet.net>
155
156 Permission to use, copy, modify, distribute, and sell this software and its
157 documentation for any purpose is hereby granted without fee, provided that
158 the above copyright notice appear in all copies and that both that copyright
159 notice and this permission notice appear in supporting documentation. No
160 representations are made about the suitability of this software for any
161 purpose. It is provided "as is" without express or implied warranty.
162
163
164 CONTACT
165 =======
166
167 Please direct any queries, bug reports etc. about XSel to the author,
168 Conrad Parker conrad@vergenet.net .
Something went wrong with that request. Please try again.