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