| 1 |
root |
1.1 |
#! perl |
| 2 |
|
|
|
| 3 |
root |
1.2 |
# this creates a simple clock using the overlay box. it is not very useful, because |
| 4 |
|
|
# it makes the iso14755 mode almost useles as its box gets destroyed every second. |
| 5 |
|
|
|
| 6 |
root |
1.1 |
use POSIX (); |
| 7 |
|
|
|
| 8 |
|
|
sub on_init { |
| 9 |
|
|
my ($self) = @_; |
| 10 |
|
|
|
| 11 |
|
|
$self->{timer} = urxvt::timer |
| 12 |
|
|
->new |
| 13 |
|
|
->start (urxvt::NOW) |
| 14 |
|
|
->cb (sub { |
| 15 |
|
|
my ($timer) = @_; |
| 16 |
|
|
my $time = $timer->at; |
| 17 |
|
|
$timer->start ($time + 1); |
| 18 |
|
|
$self->scr_overlay (-1, 0, POSIX::strftime "%H:%M:%S", localtime $time); |
| 19 |
|
|
}); |
| 20 |
|
|
|
| 21 |
|
|
() |
| 22 |
|
|
} |
| 23 |
|
|
|