ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/digital-clock
Revision: 1.10
Committed: Sun Jun 10 17:31:53 2012 UTC (11 years, 11 months ago) by root
Branch: MAIN
Changes since 1.9: +9 -1 lines
Log Message:
move perl docs to extensions

File Contents

# Content
1 #! perl
2
3 =head1 NAME
4
5 digital-clock - display a digital clock overlay
6
7 =head1 DESCRPTION
8
9 Displays a digital clock using the built-in overlay.
10
11 =cut
12
13 sub on_start {
14 my ($self) = @_;
15
16 $self->{overlay} = $self->overlay (-1, 0, 8, 1, urxvt::OVERLAY_RSTYLE, 0);
17 $self->{timer} = urxvt::timer
18 ->new
19 ->start (1 + int urxvt::NOW) # make sure we update "on" the second
20 ->interval (1)
21 ->cb (sub {
22 $self->{overlay}->set (0, 0,
23 sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2,1,0]);
24 });
25
26 ()
27 }
28
29