--- rxvt-unicode/src/perl/selection-pastebin 2014/05/17 13:38:23 1.23 +++ rxvt-unicode/src/perl/selection-pastebin 2014/05/31 08:33:47 1.25 @@ -7,6 +7,10 @@ selection-pastebin - automatic pastebin upload +=head1 EXAMPLES + + URxvt.keysym.C-M-e: selection-pastebin:remote-pastebin + =head1 DESCRIPTION This is a little rarely useful extension that uploads the selection as @@ -14,13 +18,9 @@ not currently secure for use in a multiuser environment as it writes to F directly.). -It listens to the C keyboard command, -i.e. - - URxvt.keysym.C-M-e: perl:selection-pastebin:remote-pastebin - -Pressing this combination runs a command with C<%> replaced by the name of -the textfile. This command can be set via a resource: +It listens to the C action, which, +when activated, runs a command with C<%> replaced by the name of the +textfile. This command can be set via a resource: URxvt.selection-pastebin.cmd: rsync -apP % ruth:/var/www/www.ta-sa.org/files/txt/. @@ -115,12 +115,11 @@ () } -sub on_user_command { - my ($self, $cmd) = @_; +sub on_action { + my ($self, $action) = @_; - if ($cmd eq "selection-pastebin:remote-pastebin") { - $self->upload_paste; - } + $action eq "remote-pastebin" + and $self->upload_paste; () }