Metaclip is a distributed clipboard for the X Window system.
Metaclip uses an ordinary HTTP server to keep the clipboard's contents, so it can be easily used even if the clients have dynamically assigned addresses.
Usage: metaclip < options > < URL >
-f, --file < URL > is a name of a file to read the real URL from
-s, --send Send clipboard contents to the server
-r, --receive Receive clipboard contents from the server
-v, --verbose Increase verbosity
To compile metaclip, you need libcurl and its development package.
To send the contents of your primary selection to the server, run:
metaclip --send < URL >
To receive it, run:
metaclip --receive < URL >
As the X selections are not kept in the X server, metaclip in receive mode has to continue running to be able to provide the contents of the selection to other programs. As soon as another program puts anything else to the selection, metaclip exits.
Personally, I use the Sawfish window manager and bind both command to key combinations, so the clipboard is really easy to access. If anything fails, metaclip beeps and writes its error message to the standard output, so it usually appears in ~/.xsession-errors.
You can also add the --verbose switch to see what is going on.
If you use HTTP authentication on the clipboard (which is recommended), you can write the username and password to the URL. To avoid the credentials being visible on the command line, add the --file switch and pass a name of a file containing the URL as a parameter instead of the URL itself.
As for the configuration of the web server, Apache does not support the PUT method out of the box. You can either use mod_dav (untested) or the CGI script metaclip.cgi from this package which implements GET and PUT in a very simple way. The URL's look like:
This URL corresponds to a clipboard stored in a file called `clipboard.clip' in the same directory as the CGI script. Remember to permit the web server to write to this file.