6 my $overlay = $self->overlay (-1, 0, $self->strwidth ($msg), 1, urxvt
::OVERLAY_RSTYLE
, 0);
7 $overlay->set (0, 0, $msg);
8 $self->{msg
} = urxvt
::timer
->new->after (2)->cb (sub { delete $self->{msg
}; undef $overlay; });
15 local %ENV = %{ $self->env };
16 if (my $pid = open my $fh, "|-:utf8", $self->{store_cmd
}) {
17 fcntl $fh, &Fcntl
::F_SETFL
, &Fcntl
::O_NONBLOCK
;
18 $self->{iow
} = urxvt
::iow
->new->fd (fileno $fh)->events (urxvt
::EV_WRITE
)->start->cb (sub {
19 my $txt = $self->selection;
20 my $len = syswrite $fh, $txt;
32 local %ENV = %{ $self->env };
33 if (my $pid = open my $fh, "-|:utf8", $self->{fetch_cmd
}) {
34 fcntl $fh, &Fcntl
::F_SETFL
, &Fcntl
::O_NONBLOCK
;
35 $self->{iow
} = urxvt
::iow
->new->fd (fileno $fh)->events (urxvt
::EV_READ
)->start->cb (sub {
37 my $len = sysread $fh, $txt, 8192;
39 $self->selection_clear;
40 $self->selection ($txt);
41 $self->selection_grab (urxvt
::CurrentTime
);
44 $self->tt_write ($self->locale_encode ($txt));
53 $self->{store_cmd
} = $self->x_resource ("remote-selection.store") || "cat >/tmp/distributed-selection";
54 $self->{fetch_cmd
} = $self->x_resource ("remote-selection.fetch") || "cat /tmp/distributed-selection";
60 my ($self, $cmd) = @_;
62 if ($cmd eq "clipboard:copy") {
64 } elsif ($cmd eq "clipboard:paste") {