*** empty log message ***
authorroot <root>
Mon, 2 Jan 2006 20:47:52 +0000 (20:47 +0000)
committerroot <root>
Mon, 2 Jan 2006 20:47:52 +0000 (20:47 +0000)
src/Makefile.in
src/perl/simple-overlay-clock [new file with mode: 0644]
src/urxvt.pm

index 893163e..41aa1e2 100644 (file)
@@ -98,7 +98,7 @@ install-perl:
 @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)
diff --git a/src/perl/simple-overlay-clock b/src/perl/simple-overlay-clock
new file mode 100644 (file)
index 0000000..93764fe
--- /dev/null
@@ -0,0 +1,20 @@
+#! 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);
+                    });
+
+   ()
+}
+
index 656e257..34f7d5a 100644 (file)
@@ -4,22 +4,24 @@ rxvtperl - rxvt-unicode's embedded perl interpreter
 
 =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.