--- rxvt-unicode/src/perl/digital-clock 2006/01/03 01:15:44 1.2 +++ rxvt-unicode/src/perl/digital-clock 2006/01/03 01:19:12 1.3 @@ -5,6 +5,7 @@ sub on_init { my ($self) = @_; + # force a refresh every second $self->{digital_clock_refresh} = urxvt::timer ->new ->start (urxvt::NOW) @@ -16,18 +17,20 @@ () } +# before refreshing: replace upper right with the clock display sub on_refresh_begin { my ($self) = @_; my $time = sprintf "%2d:%02d:%02d", (localtime urxvt::NOW)[2, 1, 0]; my $xpos = $self->ncol - length $time; - $self->{digital_clock_rend} = $self->ROW_r (0, [(0x00020000 + urxvt::DEFAULT_RSTYLE) x length $time], $xpos); + $self->{digital_clock_rend} = $self->ROW_r (0, [(urxvt::DEFAULT_RSTYLE) x length $time], $xpos); $self->{digital_clock_text} = $self->ROW_t (0, $time, $xpos); () } +# after refreshing: restore previous screen contents sub on_refresh_end { my ($self) = @_;