ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/simple-overlay-clock
Revision: 1.2
Committed: Mon Jan 2 20:55:36 2006 UTC (18 years, 4 months ago) by root
Branch: MAIN
Changes since 1.1: +3 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
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