… | |
… | |
12 | } |
12 | } |
13 | |
13 | |
14 | sub on_start { |
14 | sub on_start { |
15 | my ($self) = @_; |
15 | my ($self) = @_; |
16 | |
16 | |
17 | $self->{browser} = $self->x_resource ("urlLauncher") || "x-www-browser"; |
17 | $self->{browser} = $self->x_resource ("urlLauncher") || "sensible-browser"; |
18 | |
18 | |
19 | $self->grab_button (3, urxvt::ControlMask); |
19 | $self->grab_button (3, urxvt::ControlMask); |
20 | |
20 | |
21 | () |
21 | () |
22 | } |
22 | } |
… | |
… | |
72 | and $add_button->("uri unescape" => sub { s/%([0-9a-fA-F]{2})/chr hex $1/ge }); |
72 | and $add_button->("uri unescape" => sub { s/%([0-9a-fA-F]{2})/chr hex $1/ge }); |
73 | |
73 | |
74 | /[\\"'\ \t|&;<>()]/ |
74 | /[\\"'\ \t|&;<>()]/ |
75 | and $add_button->("shell quote" => sub { $_ = "\Q$_" }); |
75 | and $add_button->("shell quote" => sub { $_ = "\Q$_" }); |
76 | |
76 | |
77 | /^(http|ftp|telnet|irc|news):\// |
77 | /^(https?|ftp|telnet|irc|news):\// |
78 | and $add_button->("run $self->{browser}" => sub { $self->exec_async ($self->{browser}, $_) }); |
78 | and $add_button->("run $self->{browser}" => sub { $self->exec_async ($self->{browser}, $_) }); |
79 | |
79 | |
80 | for my $hook (@{ $self->{term}{selection_popup_hook} || [] }) { |
80 | for my $hook (@{ $self->{term}{selection_popup_hook} || [] }) { |
81 | if (my ($title, $cb) = $hook->($popup)) { |
81 | if (my ($title, $cb) = $hook->($popup)) { |
82 | $add_button->($title, $cb); |
82 | $add_button->($title, $cb); |