1 | #! perl |
1 | #! perl |
|
|
2 | |
|
|
3 | #:META:X_RESOURCE:%.store:string:the command used to store the selection |
|
|
4 | #:META:X_RESOURCE:%.fetch:string:the command used to fetch the selection |
2 | |
5 | |
3 | use Fcntl (); |
6 | use Fcntl (); |
4 | |
7 | |
5 | sub msg { |
8 | sub msg { |
6 | my ($self, $msg) = @_; |
9 | my ($self, $msg) = @_; |
… | |
… | |
82 | } |
85 | } |
83 | |
86 | |
84 | sub on_start { |
87 | sub on_start { |
85 | my ($self) = @_; |
88 | my ($self) = @_; |
86 | |
89 | |
87 | $self->{store_cmd} = $self->x_resource ("remote-selection.store") |
90 | $self->{store_cmd} = $self->x_resource ("%.store") |
88 | || "rsh ruth 'cat >/tmp/distributed-selection'"; |
91 | || "rsh ruth 'cat >/tmp/distributed-selection'"; |
89 | |
92 | |
90 | $self->{fetch_cmd} = $self->x_resource ("remote-selection.fetch") |
93 | $self->{fetch_cmd} = $self->x_resource ("%.fetch") |
91 | || "rsh ruth 'cat /tmp/distributed-selection'"; |
94 | || "rsh ruth 'cat /tmp/distributed-selection'"; |
92 | |
95 | |
93 | push @{ $self->{term}{selection_popup_hook} }, sub { |
96 | push @{ $self->{term}{selection_popup_hook} }, sub { |
94 | ("selection => remote" => sub { $self->store }) |
97 | ("selection => remote" => sub { $self->store }) |
95 | }; |
98 | }; |