July 23, 2004
I am fortunate to have two computers to use at work: a Linux desktop machine and a lightweight Windows laptop. I use the Linux machine to write and run programs, and the laptop for email, web browsing, writing documents, and working remotely from home. During the workday, they sit next to each other on my desk, and I switch back and forth between them frequently. The only problem with this arrangement is that I often will get an email message or view a web page containing commands to be executed on the Linux command line; or, I will have some program output text on the Linux machine that I want to send to someone in an email message. In that case, the half-meter distance between the two machines on my desk stands in the way of a simple cut-and-paste.
To get around this problem, I invested half a day in writing a pair of Tcl scripts which let me easily copy the contents of the Windows clipboard to the X (PRIMARY) selection on the Linux machine, and vice versa. I call this client-server system teleclip.
This system works well for me as long as the selected text is not too long; I have had some trouble with selections longer than a few thousand characters (?), which is presumably related to the way the selection mechanism divides larger amounts of data into chunks, but I have not bothered to track this down. Note that there is no security in this system other than the obscurity of the server host name and port number (which I have changed in the scripts below to protect the innocent) and the fact that the server ignores input which does not match its very limited syntax.
(Under construction...)