ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/simple-overlay-clock
Revision: 1.3
Committed: Tue Jan 3 04:18:47 2006 UTC (18 years, 4 months ago) by root
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +0 -0 lines
State: FILE REMOVED
Log Message:
*** empty log message ***

File Contents

# Content
1 #! perl
2
3 # 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 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