--- rxvt-unicode/src/perl/selection-pastebin 2006/03/10 21:36:16 1.16 +++ rxvt-unicode/src/perl/selection-pastebin 2012/06/10 13:58:06 1.19 @@ -1,5 +1,8 @@ #! perl +#:META:X_RESOURCE:%.cmd:string:the command to run create a new pastebin +#:META:X_RESOURCE:%.url:string:the url template for new pastebins + sub upload_paste { my ($self) = @_; @@ -26,7 +29,7 @@ my $cmd = $self->{pastebin_cmd}; $cmd =~ s/%/$tmpfile/; - my $pid = $self->exec_async ("/bin/sh", "-c", $cmd); + my $pid = $self->exec_async ($cmd); $self->{pw} = urxvt::pw->new->start ($pid)->cb (sub { my (undef, $status) = @_; @@ -59,10 +62,10 @@ sub on_start { my ($self) = @_; - $self->{pastebin_cmd} = $self->x_resource ("selection-pastebin.cmd") + $self->{pastebin_cmd} = $self->x_resource ("%.cmd") || "rcp -p % ruth:/var/www/www.ta-sa.org/files/txt/"; - $self->{pastebin_url} = $self->x_resource ("selection-pastebin.url") + $self->{pastebin_url} = $self->x_resource ("%.url") || "http://www.ta-sa.org/files/txt/%"; push @{ $self->{term}{selection_popup_hook} }, sub {