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

# User Rev Content
1 root 1.1 #! perl
2    
3 root 1.10 =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 root 1.1
13 root 1.9 sub on_start {
14 root 1.1 my ($self) = @_;
15    
16 root 1.7 $self->{overlay} = $self->overlay (-1, 0, 8, 1, urxvt::OVERLAY_RSTYLE, 0);
17     $self->{timer} = urxvt::timer
18 root 1.1 ->new
19 root 1.8 ->start (1 + int urxvt::NOW) # make sure we update "on" the second
20 root 1.5 ->interval (1)
21 root 1.1 ->cb (sub {
22 root 1.7 $self->{overlay}->set (0, 0,
23 root 1.5 sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2,1,0]);
24 root 1.1 });
25    
26     ()
27     }
28    
29