From cd649069eb9c9dff3c5b56e1aa0ab3e63092a014 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 18 Jan 2006 10:39:20 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 4 +--- src/perl/selection-pastebin | 14 ++++++-------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Changes b/Changes index 1446163e..7b6a3f67 100644 --- a/Changes +++ b/Changes @@ -1,19 +1,17 @@ rxvt-unicode changelog <= google-friendly title -TODO: move pty/tty handling into a fork'ed server and drop all privs +TODO: split perl documnetation and urxvt.pm into separate files TODO: harmonize --disable-options into position-dependent options. TODO: after requesting the selection and getting a timeout, no further requests will be sent. TODO: "slow" rendering mode for bidi and scripts TODO: read property sequence is broken with respect to utf-8 etc. TODO: http://www120.pair.com/mccarthy/nextstep/intro.htmld/Workspace.html is the correct nextstep look. -TODO: clarify and get rid of SMOOTH_REFRESH etc. WISH: perl extension for background image loading and moving the origin. WISH: OnTheSpot editing, or maybe switch to miiiiiiif. or maybe use perl and an overlay... WISH: just for fun, do shade and tint with XRender. WISH: support tex fonts 9.0 -TODO: on_seelction_popup hook or so. TODO: distributed clipboard example - new script: perl/selection-pastebin - improved security of setuid/setgid operation, which is now diff --git a/src/perl/selection-pastebin b/src/perl/selection-pastebin index 5bb7ab5d..fb1389ac 100644 --- a/src/perl/selection-pastebin +++ b/src/perl/selection-pastebin @@ -1,6 +1,5 @@ #! perl -my $timers = {}; my $pastebin_cmd; my $pastebin_url; @@ -16,7 +15,7 @@ sub upload_paste { 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 @@ sub upload_paste { 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/%"; -- 2.34.1