url-select: make options namespaced

This commit is contained in:
meh 2012-08-12 13:27:05 +02:00
parent 19da7013ce
commit 8d8d6e4a00
2 changed files with 11 additions and 12 deletions

View File

@ -61,9 +61,9 @@ Use Meta-u to activate URL selection mode, then use the following keys:
Options:
URxvt.urlLauncher: browser/command to open selected URL with
URxvt.underlineURLs: if set to true, all URLs get underlined
URvxt.urlButton: mouse button to click-open URLs (default: 2)
URxvt.url-select.launcher: browser/command to open selected URL with
URxvt.url-select.underline: if set to true, all URLs get underlined
URvxt.url-select.button: mouse button to click-open URLs (default: 2)
For compatibility reasons, url-select will also use any patterns defined for
the matcher extension by reading all `URxvt.matcher.pattern.[0-9]` resources.

View File

@ -21,10 +21,9 @@
# q/Escape: Deactivate URL selection mode
# Options:
# URxvt.urlLauncher: Browser/command to open selected URL with
# URxvt.underlineURLs: If set to true, all URLs get underlined
# URvxt.urlButton: Mouse button to click-open URLs (default: 2)
# URxvt.url-select.launcher: Browser/command to open selected URL with
# URxvt.url-select.underline: If set to true, all URLs get underlined
# URvxt.url-select.button: Mouse button to click-open URLs (default: 2)
use strict;
@ -32,16 +31,16 @@ sub on_start {
my ($self) = @_;
# read resource settings
if ($self->x_resource('urlLauncher')) {
@{$self->{browser}} = split /\s+/, $self->x_resource('urlLauncher');
if ($self->x_resource('url-select.launcher')) {
@{$self->{browser}} = split /\s+/, $self->x_resource('url-select.launcher');
} else {
@{$self->{browser}} = ('x-www-browser');
}
if ($self->x_resource('underlineURLs') eq 'true') {
if ($self->x_resource('url-select.underline') eq 'true') {
$self->enable(line_update => \&line_update);
}
if ($self->x_resource('urlButton') =~ /^\d+$/) {
$self->{button} = $self->x_resource('urlButton');
if ($self->x_resource('url-select.button') =~ /^\d+$/) {
$self->{button} = $self->x_resource('url-select.button');
} elsif ($self->x_resource('matcher.button') =~ /^\d+$/) {
$self->{button} = $self->x_resource('matcher.button');
} else {