| 1 |
autocutsel |
| 2 |
http://www.nongnu.org/autocutsel/ |
| 3 |
https://github.com/sigmike/autocutsel |
| 4 |
Copyright (c) 2001-2021 - Michael Witrant |
| 5 |
|
| 6 |
X servers use two schemes to copy text between applications. The first one |
| 7 |
(old and deprecated) is the cutbuffer. It is a simple buffer in which any |
| 8 |
application can store text. The other scheme is the selection and works |
| 9 |
differently. There may be many selections in a single server. An |
| 10 |
application does not copy data in a selection, it "owns" it. When |
| 11 |
another application wants to retreive the content of a selection, it |
| 12 |
asks the owner. |
| 13 |
|
| 14 |
Recent desktop applications (GNOME, KDE, ...) use two selections: the |
| 15 |
PRIMARY and the CLIPBOARD. The PRIMARY selection is used when you select |
| 16 |
some text with the mouse. You usually paste it using the middle button. The |
| 17 |
CLIPBOARD selection is used when you copy text by using, for example, |
| 18 |
the Edit/Copy menu. You may paste it using the Edit/Paste menu. |
| 19 |
|
| 20 |
Windows VNC clients keep the Windows clipboard synchronized with the |
| 21 |
cutbuffer, but not with the selections. And since recent applications |
| 22 |
don't use the cutbuffer, the server's CLIPBOARD is never synchronized |
| 23 |
with Windows' one. |
| 24 |
|
| 25 |
Autocutsel tracks changes in the server's cutbuffer and CLIPBOARD |
| 26 |
selection. When the CLIPBOARD is changed, it updates the cutbuffer. When |
| 27 |
the cutbuffer is changed, it owns the CLIPBOARD selection. The cutbuffer |
| 28 |
and CLIPBOARD selection are always synchronized. Since the VNC client |
| 29 |
synchronizes the Windows' clipboard and the server's cutbuffer, all |
| 30 |
three "clipboards" are always kept synchronized. When you copy some text in |
| 31 |
Windows, the cutbuffer and the CLIPBOARD selection are updated. When you |
| 32 |
copy text on the server using either the cutbuffer or the CLIPBOARD |
| 33 |
selection, the Windows's clipboard is always updated. |
| 34 |
|
| 35 |
To build autocutsel: |
| 36 |
./configure |
| 37 |
make |
| 38 |
|
| 39 |
If you downloaded autocutsel from git you first have to run ./bootstrap to |
| 40 |
build the configure script. |
| 41 |
|
| 42 |
If configure fails because it can't find X or Xaw libraries, you may have to |
| 43 |
install the devel packages of these libraries. |
| 44 |
|
| 45 |
On Ubuntu, you may need to install these packages : |
| 46 |
sudo apt-get install libc6-dev libxtst-dev xorg-dev |
| 47 |
|
| 48 |
To install it (as root): |
| 49 |
make install |
| 50 |
|
| 51 |
To run it: |
| 52 |
autocutsel |
| 53 |
|
| 54 |
By default, autocutsel synchronizes the CLIPBOARD selection. You may want to use |
| 55 |
the PRIMARY selection instead, if your applications use Motif or another toolkit |
| 56 |
not using the CLIPBOARD. To do that, simply run |
| 57 |
autocutsel -selection PRIMARY |
| 58 |
|
| 59 |
Some softwares (like Open Office Writer) have trouble when the PRIMARY selection |
| 60 |
is requested before the mouse button is released. As a workaround, you can run |
| 61 |
autocutsel with the "-buttonup" option and it will only get the selection when |
| 62 |
the first mouse button is not pressed. |
| 63 |
|
| 64 |
Any feedback is welcome. |
| 65 |
|
| 66 |
Michael Witrant <mike at lepton.fr> |
| 67 |
|
| 68 |
|
| 69 |
This program is free software; you can redistribute it and/or modify |
| 70 |
it under the terms of the GNU General Public License as published by |
| 71 |
the Free Software Foundation; either version 2 of the License, or |
| 72 |
(at your option) any later version. |
| 73 |
|
| 74 |
This program is distributed in the hope that it will be useful, |
| 75 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 76 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 77 |
GNU General Public License for more details. |
| 78 |
|
| 79 |
You should have received a copy of the GNU General Public License |
| 80 |
along with this program; if not, write to the Free Software |
| 81 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |