aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSterling Camden <sterling@camdensoftware.com>2010-11-24 09:46:20 -0800
committerSterling Camden <sterling@camdensoftware.com>2010-11-24 09:46:20 -0800
commit9638ded3cc2b9494a207a327168612aa9708ad74 (patch)
treec5188008507e55e4439640500172c14d74db02a8
parentd6c6841fa3d12be92fb0b86837791023adc1cd5d (diff)
Display status message containing URL for five seconds when launching.
-rw-r--r--README3
-rw-r--r--url-picker25
2 files changed, 17 insertions, 11 deletions
diff --git a/README b/README
index d0f79ea..85e9bb8 100644
--- a/README
+++ b/README
@@ -62,4 +62,5 @@ The backspace key erases the last number typed, if there is one.
When a URL is launched, all overlay windows are removed and the cursor
position is restored to where it was in the terminal window before
-url-picker was invoked.
+url-picker was invoked. The url launched is displayed on the bottom
+row of the terminal window for five seconds.
diff --git a/url-picker b/url-picker
index 7c52855..7cb6407 100644
--- a/url-picker
+++ b/url-picker
@@ -36,16 +36,7 @@ sub on_user_command {
}
if ($num < 1) {
- my $ermsg = $self->overlay(0,-1,35,1,urxvt::OVERLAY_RSTYLE,0);
- $ermsg->set(0,0,"url-picker: no URLs found on screen");
- $self->{ermsg} = $ermsg;
- $self->{timer} = urxvt::timer
- ->new
- ->after (5)
- ->cb (sub {
- $self->{ermsg} = ();
- $self->{timer} = ();
- });
+ $self->status_msg("url-picker: no URLs found on screen");
} else {
my $url_picker = {};
$url_picker->{prompt} = $self->overlay(
@@ -129,9 +120,23 @@ sub launch {
$self->screen_cur($p->{crow},$p->{ccol});
$self->{url_picker} = ();
my $launcher = $self->{launcher};
+ $self->status_msg($href);
$self->exec_async ($launcher,$href);
}
+sub status_msg {
+ my ($self, $msg) = @_;
+ $self->{url_picker_msg} = $self->overlay(0,-1,length($msg),1,urxvt::OVERLAY_RSTYLE,0);
+ $self->{url_picker_msg}->set(0,0,$msg);
+ $self->{url_picker_timer} = urxvt::timer
+ ->new
+ ->after (5)
+ ->cb (sub {
+ $self->{url_picker_msg} = ();
+ $self->{url_pickertimer} = ();
+ });
+}
+
sub on_key_release {
my ($self, $event, $keysym) = @_;
$self->{url_picker};