| Revision: | 1.12 |
| Committed: | Tue Sep 4 22:41:11 2012 UTC (14 years, 1 month ago) by root |
| Branch: | MAIN |
| CVS Tags: | rxvt-unicode-rel-9_29, rxvt-unicode-rel-9_26, rxvt-unicode-rel-9_25, rxvt-unicode-rel-9_22, rxvt-unicode-rel-9_20, rxvt-unicode-rel-9_21, rxvt-unicode-rel-9_19, rxvt-unicode-rel-9_18, rxvt-unicode-rel-9_17, rxvt-unicode-rel-9_16, rxvt-unicode-rel-9_30, HEAD |
| Changes since 1.11: | +1 -1 lines |
| Log Message: | *** empty log message *** |
| # | User | Rev | Content |
|---|---|---|---|
| 1 | root | 1.1 | #! perl |
| 2 | |||
| 3 | root | 1.10 | =head1 NAME |
| 4 | |||
| 5 | root | 1.12 | digital-clock - display a digital clock overlay |
| 6 | root | 1.10 | |
| 7 | root | 1.11 | =head1 DESCRIPTION |
| 8 | root | 1.10 | |
| 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 |