--- rxvt-unicode/src/perl/selection-pastebin 2006/01/18 10:31:37 1.6 +++ rxvt-unicode/src/perl/selection-pastebin 2006/01/18 10:39:20 1.7 @@ -1,6 +1,5 @@ #! perl -my $timers = {}; my $pastebin_cmd; my $pastebin_url; @@ -16,7 +15,7 @@ my $msg = "uploaded $filename"; - if (open my $o, ">$tmpfile") { + if (open my $o, ">", $tmpfile) { chmod 0644, $tmpfile; print $o $txt; close $o; @@ -38,21 +37,20 @@ unlink $tmpfile; - my $ov = $timers->{ov} = $self->overlay (-1, 0, length ($msg), 1, urxvt::OVERLAY_RSTYLE, 0); + my $ov = $self->overlay (-1, 0, length $msg, 1, urxvt::OVERLAY_RSTYLE, 0); $ov->set (0, 0, $msg); - $timers->{t1} = + my $timer; $timer = urxvt::timer ->new - ->start ((int urxvt::NOW) + 5) # make sure we update "on" the second - ->interval (1) - ->cb (sub { delete $timers->{ov}; delete $timers->{t1}; }); + ->start (urxvt::NOW + 5) + ->cb (sub {undef $timer; undef $ov; }); } sub on_start { my ($self) = @_; $pastebin_cmd = $self->x_resource ("selection-pastebin.cmd") - || "scp -p % ruth:/var/www/www.ta-sa.org/files/txt/"; + || "rcp -p % ruth:/var/www/www.ta-sa.org/files/txt/"; $pastebin_url = $self->x_resource ("selection-pastebin.url") || "http://www.ta-sa.org/files/txt/%";