1 | #! perl |
1 | #! perl |
|
|
2 | |
|
|
3 | =head1 NAME |
|
|
4 | |
|
|
5 | uake<hotkey> - kuake-like hotkey terminal |
|
|
6 | |
|
|
7 | =head1 DESCRIPTION |
|
|
8 | |
|
|
9 | A very primitive quake-console-like extension. It was inspired by a |
|
|
10 | description of how the programs C<kuake> and C<yakuake> work: Whenever the |
|
|
11 | user presses a global accelerator key (by default C<F10>), the terminal |
|
|
12 | will show or hide itself. Another press of the accelerator key will hide |
|
|
13 | or show it again. |
|
|
14 | |
|
|
15 | Initially, the window will not be shown when using this extension. |
|
|
16 | |
|
|
17 | This is useful if you need a single terminal that is not using any desktop |
|
|
18 | space most of the time but is quickly available at the press of a key. |
|
|
19 | |
|
|
20 | The accelerator key is grabbed regardless of any modifiers, so this |
|
|
21 | extension will actually grab a physical key just for this function. |
|
|
22 | |
|
|
23 | If you want a quake-like animation, tell your window manager to do so |
|
|
24 | (fvwm can do it). |
|
|
25 | |
|
|
26 | =cut |
2 | |
27 | |
3 | sub on_start { |
28 | sub on_start { |
4 | my ($self) = @_; |
29 | my ($self) = @_; |
5 | |
30 | |
6 | $self->{key} = $self->{argv}[0] || "F10"; |
31 | $self->{key} = $self->{argv}[0] || "F10"; |
… | |
… | |
24 | my ($self) = @_; |
49 | my ($self) = @_; |
25 | |
50 | |
26 | # suppress initial map event |
51 | # suppress initial map event |
27 | $self->XUnmapWindow ($self->parent) |
52 | $self->XUnmapWindow ($self->parent) |
28 | if delete $self->{unmap_me}; |
53 | if delete $self->{unmap_me}; |
29 | |
54 | |
30 | () |
55 | () |
31 | } |
56 | } |
32 | |
57 | |
33 | sub on_root_event { |
58 | sub on_root_event { |
34 | my ($self, $event) = @_; |
59 | my ($self, $event) = @_; |