uclip - command-line interface to the X clipboard (aka "selections")
SYNOPSIS
uclip [OPTION]... [FILE]...
DESCRIPTION
uclip is a command-line interface to the X clipboard. It either copies text,
from FILE or from stdin, to the X clipboard, or prints the X clipboard to std-
out. uclip supports Unicode and is locale-aware (in contrast to other similar
utilities). uclip was written using Qt.
You can download uclip from:
http://www.typo.co.il/~mooffie/uclip/download/
If no OPTION is specified, uclip prints the X clipboard to stdout.
OPTIONS
-f,-o Prints the X clipboard to stdout. This is the default action, unless
FILE, '-a', or '-r', are given.
-t,-i Copies the text from FILE, or from stdin if no FILE is specified, to the
X clipboard. Actually, this switch is only needed when reading from
stdin, because it is implied when a FILE is given.
uclip forks and waits in the background serving requests till some other
application (or another invocation of uclip) takes over the X selection.
-u Do input/output in UTF-8, regardless of the locale. If '-u' is not speci-
fied, uclip does input/output in the locale's encoding.
-c Use XA_CLIPBOARD (the default). This usually corresponds to the text you
explicitly copy to the clipboard using your application's "Copy" command.
-s Use XA_PRIMARY instead of XA_CLIPBOARD. This usually corresponds to the
text highlighted with the mouse.
-z Clear the clipboard.
-a Append to the clipboard instead of replacing it.
-r Replace the contents of the clipbord. This is the default and is the com-
plement of '-a'.
EXAMPLES
$wget`uclip-s`
Assuming you double clicked the URL address in your browser, this down-
loads the document.
$/usr/games/fortune|tee/dev/tty|uclip-s-
Print a fortune cookie and copy it to the X selection so that later you
can insert it into you mail message using the middle mouse button ('-' is
a synonym for stdin, so it's not necessary to specify '-t').
$uclip*.txt
Copy the contents of all txt files to the clipboard.
$uclip-s|uclip-s-t
You can now exit the application without worrying about losing the selec-
tion.
$xterm-elinks"www.dictionary.com/search?q=$(uclip-s|tr'''+')"
Open a new window with the definition of the highlighted word.
:r!uclip
Type this in VI to paste the clipboard into the buffer.
BUGS
The '-display' option is not supported. Do "DISPLAY=... uclip" instead.
uclip doesn't warn you when it fails to convert between encodings. For example,
when you do "uclip FILE" in a UTF-8 locale, and FILE is encoded in ISO-8859-8,
uclip just writes gibberish to the clipboard.
AUTHOR
Mooffie <mooffie@typo.co.il>
KEYWORDS
How to copy/paste, or get/set, the X11 selection, X11 clipboard, from shell
script, scripts. standard input, output.