From 8d8d6e4a0024a4d24cbed866f456fd4d786bc880 Mon Sep 17 00:00:00 2001 From: meh Date: Sun, 12 Aug 2012 13:27:05 +0200 Subject: [PATCH] url-select: make options namespaced --- README.md | 6 +++--- url-select | 17 ++++++++--------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 27f2886..9a87d98 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/url-select b/url-select index bea92f6..0bfdb06 100644 --- a/url-select +++ b/url-select @@ -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 {