1 | #! perl |
1 | #! perl |
|
|
2 | |
|
|
3 | #:META:X_RESOURCE:url-launcher:string:shell command to use |
2 | |
4 | |
3 | sub msg { |
5 | sub msg { |
4 | my ($self, $msg) = @_; |
6 | my ($self, $msg) = @_; |
5 | |
7 | |
6 | my $overlay = $self->overlay (0, 0, $self->strwidth ($msg), 1); |
8 | my $overlay = $self->overlay (0, 0, $self->strwidth ($msg), 1); |
… | |
… | |
12 | } |
14 | } |
13 | |
15 | |
14 | sub on_start { |
16 | sub on_start { |
15 | my ($self) = @_; |
17 | my ($self) = @_; |
16 | |
18 | |
17 | $self->{browser} = $self->x_resource ("urlLauncher") || "sensible-browser"; |
19 | $self->{browser} = $self->x_resource ("url-launcher") || "sensible-browser"; |
18 | |
20 | |
19 | $self->grab_button (3, urxvt::ControlMask); |
21 | $self->grab_button (3, urxvt::ControlMask); |
20 | |
22 | |
21 | () |
23 | () |
22 | } |
24 | } |
… | |
… | |
61 | |
63 | |
62 | /./ |
64 | /./ |
63 | and $add_button->("rot13" => sub { y/A-Za-z/N-ZA-Mn-za-m/ }); |
65 | and $add_button->("rot13" => sub { y/A-Za-z/N-ZA-Mn-za-m/ }); |
64 | |
66 | |
65 | /./ |
67 | /./ |
66 | and $add_button->("eval perl expression" => sub { no warnings; $_ = eval $_ }); |
68 | and $add_button->("eval perl expression" => sub { my $self = $self; no warnings; $_ = eval $_; $_ = "$@" if $@ }); |
67 | |
69 | |
68 | /./ |
70 | /./ |
69 | and $add_button->((sprintf "to unicode hex index (%x)", ord) => sub { $_ = sprintf "%x", ord }); |
71 | and $add_button->((sprintf "to unicode hex index (%x)", ord) => sub { $_ = sprintf "%x", ord }); |
70 | |
72 | |
71 | /(\S+):(\d+):?/ |
73 | /(\S+):(\d+):?/ |