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