ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/selection-pastebin
(Generate patch)

Comparing rxvt-unicode/src/perl/selection-pastebin (file contents):
Revision 1.21 by root, Sun Jun 10 17:39:54 2012 UTC vs.
Revision 1.26 by sf-exg, Mon Jun 9 19:54:26 2014 UTC

1#! perl 1#! perl
2 2
3#:META:X_RESOURCE:%.cmd:string:the command to run create a new pastebin 3#:META:RESOURCE:%.cmd:string:the command to run create a new pastebin
4#:META:X_RESOURCE:%.url:string:the url template for new pastebins 4#:META:RESOURCE:%.url:string:the url template for new pastebins
5 5
6=head1 NAME 6=head1 NAME
7 7
8 selection-pastebin - automatic pastebin upload 8selection-pastebin - automatic pastebin upload
9
10=head1 EXAMPLES
11
12 URxvt.keysym.C-M-e: selection-pastebin:remote-pastebin
9 13
10=head1 DESCRIPTION 14=head1 DESCRIPTION
11 15
12This is a little rarely useful extension that uploads the selection as 16This is a little rarely useful extension that uploads the selection as
13textfile to a remote site (or does other things). (The implementation is 17textfile to a remote site (or does other things). (The implementation is
14not currently secure for use in a multiuser environment as it writes to 18not currently secure for use in a multiuser environment as it writes to
15F</tmp> directly.). 19F</tmp> directly.).
16 20
17It listens to the C<selection-pastebin:remote-pastebin> keyboard command, 21It listens to the C<selection-pastebin:remote-pastebin> action, which,
18i.e. 22when activated, runs a command with C<%> replaced by the name of the
19
20 URxvt.keysym.C-M-e: perl:selection-pastebin:remote-pastebin
21
22Pressing this combination runs a command with C<%> replaced by the name of
23the textfile. This command can be set via a resource: 23textfile. This command can be set via a resource:
24 24
25 URxvt.selection-pastebin.cmd: rsync -apP % ruth:/var/www/www.ta-sa.org/files/txt/. 25 URxvt.selection-pastebin.cmd: rsync -apP % ruth:/var/www/www.ta-sa.org/files/txt/.
26 26
27And the default is likely not useful to anybody but the few people around 27And the default is likely not useful to anybody but the few people around
28here :) 28here :)
123 } 123 }
124 124
125 () 125 ()
126} 126}
127 127
128sub on_action {
129 my ($self, $action) = @_;
130
131 $action eq "remote-pastebin"
132 and $self->upload_paste;
133
134 ()
135}
136

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines