mwinclip.pl
A Perl Script to copy text between MS Windows and X Clipboard
(A replacement for xwinclip)
|
First Released:
|
May-26-2003
|
Last Updated (ChangeLog):
|
Sep-26-2004
|
mwinclip.pl is a simple Perl script to copy text between
Windows and X
Clipboard under
cygwin XFree86. I wrote
it because
xwinclip gives me too much trouble. I use
cygwin tools in Windows for a long time. When
cygwin came out with XFree86 I switched from
Hummingbard Exceed X to XFree86. I looked around and found
xwinclip.
Here're the things I don't like about xwinclip:
- xwinclip clears away the highlighted selection right away on an xterm.
I don't like it.
- Right after starting it would work fine for a while, then slowly it'd
start acting crazy and eventually stop working. Sometimes it just exits and refuse to work
even if I restart it millions of times.
- In some xterms, it interferes with Visual selection of vim.
mwinclip.pl uses
xclip.exe to set and get text from X Clipboard. For
gettting and setting text to Windows Clipboard it uses the Win32 Perl
Clipboard module (Comes with ActiveState Perl).
Note: I do not use or maintain it anymore. (updated: Mar-04-2012)
How it works
There's nothing fancy in this script. In every 1 second (change it if you
want) it checks the Windows and X Clipboards for texts, and if it finds
anything in one, it copies the text to the other.
How to use
-
Download:
Source
|
File:
|
mwinclip1.2.zip
|
Size:
|
143857 bytes
|
MD5 Checksum:
|
bb9715bf2a89051f4841bb36475537d7
|
Last updated:
|
May-25-2003
|
xclip.exe is included but you can get the source
and compile it yourself. You only need cygwin gcc to compile.
- unzip the archive:
$ unzip mwinclip1.2.zip
Archive: mwinclip1.2.zip
creating: mwinclip1.2/
inflating: mwinclip1.2/mwinclip.pl
inflating: mwinclip1.2/README
inflating: mwinclip1.2/xclip.exe
$ cd mwinclip1.2
|
- Look at the script,
mwinclip.pl and see if you need to change
anything.
- Make sure you've
ActiveState Perl is installed in your
Windows box.
Note: cygwin perl will not work as it does not have the Win32 Clipboard module.
- Make sure you've Digest::MD5 perl module installed.
- Make usre
/usr/X11R6/bin is in your PATH or you'll get some DLL not found errors.
- In your Windows box, open a bash shell. Don't forget to set your
DISPLAY env variable.
Example:
$ export DISPLAY=127.0.0.1:0
$ perl mwinclip.pl
|
Here's an example session:
$ perl mwinclip.pl 2>/dev/null
Sun Sep 26 10:54:46 2004: Windows->X: 45 bytes
Sun Sep 26 10:54:54 2004: X->Windows: 2287 bytes
Sun Sep 26 10:55:20 2004: Windows->X: 46 bytes
Sun Sep 26 10:55:23 2004: Windows->X: 3 bytes
Sun Sep 26 10:55:27 2004: Windows->X: 3 bytes
Sun Sep 26 10:55:37 2004: X->Windows: 212 bytes
Sun Sep 26 10:56:02 2004: Windows->X: 2 bytes
|
Bugs
I noticed every now and then
xclip.exe complaints about could not open Display.
You can ignore this error message (by sending stderr to
/dev/null like
I do). Other than that it works well all the time.
If you use this script,
Please let me know.
Copyright
Freeware. Do whatever you like with it.
THIS PROGRAM IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE
AUTHOR Muhammad A. Muquit BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTUOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
ChangeLog
v1.2
- Uses Digest::MD5 perl mdoule to detect changes in clipboard.
(Sep-26-2004)
v1.1
- Initial relase
(May-26-2003)
URL of this page: http://www.muquit.com/muquit/software/mwinclip_pl/mwinclip_pl.html
|