url-select: new o/q keyboard mappings
https://bbs.archlinux.org/viewtopic.php?pid=810493#p810493
This commit is contained in:
parent
94d5f77e83
commit
91cd34f1a1
22
url-select
22
url-select
@ -14,15 +14,15 @@
|
|||||||
# URxvt.keysym.M-u: perl:url-select:select_next
|
# URxvt.keysym.M-u: perl:url-select:select_next
|
||||||
|
|
||||||
# Use Meta-u to activate URL selection mode, then use the following keys:
|
# Use Meta-u to activate URL selection mode, then use the following keys:
|
||||||
# k: select next upward URL (also with Meta-u)
|
# k: Select next upward URL (also with Meta-u)
|
||||||
# j: select next downward URL
|
# j: Select next downward URL
|
||||||
# Return: open selected URL in browser and quit selection mode
|
# o/Return: Open selected URL in browser, Return: deactivate afterwards
|
||||||
# y: copy (yank) selected URL and quit selection mode
|
# y: Copy (yank) selected URL and deactivate selection mode
|
||||||
# Escape: cancel URL selection mode
|
# q/Escape: Deactivate URL selection mode
|
||||||
|
|
||||||
# Options:
|
# Options:
|
||||||
# URxvt.urlLauncher: browser/command to open selected URL with
|
# URxvt.urlLauncher: Browser/command to open selected URL with
|
||||||
# URxvt.underlineURLs: if set to true, all URLs get underlined
|
# URxvt.underlineURLs: If set to true, all URLs get underlined
|
||||||
|
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
@ -95,13 +95,11 @@ sub key_press {
|
|||||||
my ($self, $event, $keysym) = @_;
|
my ($self, $event, $keysym) = @_;
|
||||||
my $char = chr($keysym);
|
my $char = chr($keysym);
|
||||||
|
|
||||||
if ($keysym == 0xff1b) {
|
if ($keysym == 0xff1b || lc($char) eq 'q') {
|
||||||
# escape
|
|
||||||
deactivate($self);
|
deactivate($self);
|
||||||
} elsif ($keysym == 0xff0d) {
|
} elsif ($keysym == 0xff0d || $char eq 'o') {
|
||||||
# return
|
|
||||||
$self->exec_async($self->{browser}, ${$self->{found}[$self->{n}]}[4]);
|
$self->exec_async($self->{browser}, ${$self->{found}[$self->{n}]}[4]);
|
||||||
deactivate($self);
|
deactivate($self) unless $char eq 'o';
|
||||||
} elsif ($char eq 'y') {
|
} elsif ($char eq 'y') {
|
||||||
$self->selection(${$self->{found}[$self->{n}]}[4]);
|
$self->selection(${$self->{found}[$self->{n}]}[4]);
|
||||||
$self->selection_grab($event->{time});
|
$self->selection_grab($event->{time});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user