Zentara wrote:
On Fri, 10 Jun 2005 11:07:29 +0200, [EMAIL PROTECTED] (MNibble) wrote:
aloha
how do i pipe to the x clipboard from perl ?
Are there diffrent ways from on X to an other ( x.org, Xfree86 )
MNibble
There are alot of difficulties giving a one shot answer, because what
works on one app and window manager may not work on another.
There is the recent Clipboard module, which uses the xclip utility,
so you could just as well use xclip with system.
You have to be carful of the "selection" argument of xclip.
xclip -i -selection primary
will put it into the mouse, so a middle mouse click will paste.
xclip -i -selection 'clipboard'
will put it so you can copy it from the "Paste" of the apps menubar.
If you can use Tk, it has a pretty good clipboard , but on my machine it
seems "quirky" because it will put it onto the 'clipboard' but only
as long as the tk app is running. It will clear itself out after exiting
and the clipdata is lost.
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
use Tk::Clipboard;
my $mw = tkinit;
$mw->withdraw; #use Tk without showing a window
my $content = 'foobar'.time;
print "$content\n";
$mw->clipboardClear;
$mw->clipboardAppend($content);
MainLoop;
__END__
Anyways, those are some ideas. Read the docs, and make
sure you distinquish between the primary, secondary, and clipboard
buffers.
Thx for that, i didn't thought off the xclipboard as a programm on it's own.
So i didn't check for a programm with that name in the first place ... .
This gave me the right direction.
MNibble
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>