diff options
-rw-r--r-- | README | 5 | ||||
-rw-r--r-- | url-picker | 5 |
2 files changed, 9 insertions, 1 deletions
@@ -72,6 +72,10 @@ position is restored to where it was in the terminal window before url-picker was invoked. The url launched is displayed on the bottom row of the terminal window for five seconds. +To avoid surprises, the resource `url-picker.launchsingle` can be set to +`false` to stop url-picker from automatically launching a single (sole) found +URL, until its number has been typed. + RESOURCES The following resources are recognized by url-picker: @@ -82,6 +86,7 @@ URxvt.url-picker.input.foregroundColor Fg color for numbers typed URxvt.url-picker.label.backgroundColor Bg color for numbered labels URxvt.url-picker.label.foregroundColor Fg color for numbered labels URxvt.url-picker.launcher Browser override +URxvt.url-picker.launchsingle "false" to not auto-launch single url URXVT.url-picker.order "descending" numbers in reverse URxvt.url-picker.prompt.backgroundColor Bg color for "Follow:" prompt URxvt.url-picker.prompt.foregroundColor Fg color for "Follow:" prompt @@ -151,7 +151,9 @@ sub update { $overlay->hide; } } - if (scalar(@matches) == 1) { + # Auto-launch a single url only if the launchsingle resource is true + # (default), or if some digits were input + if (scalar(@matches) == 1 && ($self->{launchsingle} || $len > 0)) { $self->launch(@matches[0]); } else { $self->screen_cur($self->nrow,8+$len); @@ -206,6 +208,7 @@ sub on_start { $self->{launcher} = $self->my_resource("launcher") || $self->x_resource("url-launcher") || "sensible-browser"; + $self->{launchsingle} = ($self->my_resource("launchsingle") ne "false"); $self->{descending} = ($self->my_resource("order") eq "descending"); $self->{url_picker} = (); } |