1 |
root |
1.1 |
#! perl |
2 |
|
|
|
3 |
root |
1.4 |
sub on_start { |
4 |
|
|
my ($self) = @_; |
5 |
|
|
|
6 |
root |
1.7 |
$self->grab_button (2, urxvt::ControlMask); |
7 |
root |
1.4 |
} |
8 |
|
|
|
9 |
root |
1.1 |
sub on_button_press { |
10 |
|
|
my ($self, $event) = @_; |
11 |
|
|
|
12 |
root |
1.7 |
if ($event->{button} == 2 && $event->{state} & urxvt::ControlMask) { |
13 |
root |
1.6 |
my $popup = $self->popup ($event) |
14 |
root |
1.7 |
or return 1; |
15 |
root |
1.1 |
|
16 |
root |
1.5 |
$popup->add_title ("Options"); |
17 |
|
|
$popup->add_separator; |
18 |
|
|
|
19 |
root |
1.1 |
my %unsafe = map +($_ => 1), |
20 |
|
|
qw(borderLess console iconic loginShell reverseVideo |
21 |
|
|
scrollBar scrollBar_floating scrollBar_right |
22 |
root |
1.3 |
secondaryScreen transparent utmpInhibit meta8); |
23 |
root |
1.1 |
|
24 |
|
|
for my $name (sort keys %urxvt::OPTION) { |
25 |
|
|
next if $unsafe{$name}; |
26 |
|
|
|
27 |
|
|
my $optval = $urxvt::OPTION{$name}; |
28 |
|
|
|
29 |
root |
1.2 |
$popup->add_toggle ($name => sub { $self->option ($optval, $_[0]) }, |
30 |
root |
1.1 |
$self->option ($optval)); |
31 |
|
|
} |
32 |
|
|
|
33 |
|
|
$popup->show; |
34 |
|
|
|
35 |
|
|
return 1; |
36 |
|
|
} |
37 |
|
|
|
38 |
|
|
() |
39 |
|
|
} |
40 |
|
|
|