@IF_PERL@ $(INSTALL) -d $(DESTDIR)$(libdir)/urxvt
@IF_PERL@ $(INSTALL) -d $(DESTDIR)$(libdir)/urxvt/perl
@IF_PERL@ $(INSTALL_DATA) urxvt.pm $(DESTDIR)$(libdir)/urxvt/urxvt.pm
-@IF_PERL@ for ext in perl/*; do test -f "$$ext" && $(INSTALL_DATA) "$$ext" $(DESTDIR)$(libdir)/urxvt/"$$ext"; done
+@IF_PERL@ -for ext in perl/*; do test -f "$$ext" && $(INSTALL_DATA) "$$ext" $(DESTDIR)$(libdir)/urxvt/"$$ext"; done
install: allbin alldoc install-perl
$(INSTALL) -d $(DESTDIR)$(bindir)
--- /dev/null
+#! perl
+
+use POSIX ();
+
+sub on_init {
+ my ($self) = @_;
+
+ $self->{timer} = urxvt::timer
+ ->new
+ ->start (urxvt::NOW)
+ ->cb (sub {
+ my ($timer) = @_;
+ my $time = $timer->at;
+ $timer->start ($time + 1);
+ $self->scr_overlay (-1, 0, POSIX::strftime "%H:%M:%S", localtime $time);
+ });
+
+ ()
+}
+
=head1 SYNOPSIS
-* Put your scripts into F<@@RXVT_LIBDIR@@/urxvt/perl/>, they will be loaded automatically.
-
-* Scripts are evaluated in a 'use strict' and 'use utf8' environment, and
-thus must be encoded as UTF-8.
+ # create a file grab_test in $HOME:
sub on_sel_grab {
warn "you selected ", $_[0]->selection;
()
}
- 1
+ # start a @@RXVT_NAME@@ using it:
+
+ @@RXVT_NAME@@ --perl-lib $HOME -pe grab_test
=head1 DESCRIPTION
Everytime a terminal object gets created, scripts specified via the
-C<perl> resource are associated with it.
+C<perl> resource are loaded and associated with it.
+
+Scripts are compiled in a 'use strict' and 'use utf8' environment, and
+thus must be encoded as UTF-8.
Each script will only ever be loaded once, even in @@RXVT_NAME@@d, where
scripts will be shared (But not enabled) for all terminals.