From: root
If string takes the form perl:STRING
, then the specified STRING
+is passed to the on_keyboard_command
perl handler. See the rxvtperl(3)
+manpage. For example, the selection extension (activated via
+rxvt -pe selection
) listens for selection:rot13
events:
+ URxvt.keysym.M-C-c: perl:selection:rot13+
Due the the large number of modifier combinations, a defined key mapping
will match if at at least the specified identifiers are being set, and
no other key mappings with those and more bits are being defined. That
@@ -1437,7 +1447,7 @@ Perl code to be evaluated when all extensions have been registered. See the
Colon-separated list of additional directories that hold extension
scripts. When looking for extensions specified by the perl
resource,
rxvt will first look in these directories and then in
-/opt/rxvt/lib/urxvt/perl-ext/.
+/opt/rxvt/lib/urxvt/perl/.
See the rxvtperl(3)
manpage.
* Put your scripts into /opt/rxvt/lib/urxvt/perl-ext/, 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 using it: +
+ rxvt --perl-lib $HOME -pe grab_test
Everytime a terminal object gets created, scripts specified via the
-perl
resource are associated with it.
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 rxvtd, where scripts will be shared (But not enabled) for all terminals.
@@ -184,6 +187,14 @@ code is run after this hook, and takes precedence.
on_refresh_begin
.
perl:string
action bound to it (see description of the keysym
+resource in the rxvt(1)
manpage).
+diff --git a/doc/rxvtperl.3.man.in b/doc/rxvtperl.3.man.in index c00bd974..fedbc93d 100644 --- a/doc/rxvtperl.3.man.in +++ b/doc/rxvtperl.3.man.in @@ -131,13 +131,12 @@ .IX Title "rxvt 3" .TH rxvt 3 "2006-01-02" "6.2" "RXVT-UNICODE" .SH "NAME" -rxvtperl \- rxvt\-unicode's embedded perl interpreter +@@RXVT_NAME@@perl \- rxvt\-unicode's embedded perl interpreter .SH "SYNOPSIS" .IX Header "SYNOPSIS" -* Put your scripts into \fI@@RXVT_LIBDIR@@/urxvt/perl\-ext/\fR, they will be loaded automatically. -.PP -* Scripts are evaluated in a 'use strict' and 'use utf8' environment, and -thus must be encoded as \s-1UTF\-8\s0. +.Vb 1 +\& # create a file grab_test in $HOME: +.Ve .PP .Vb 4 \& sub on_sel_grab { @@ -147,12 +146,19 @@ thus must be encoded as \s-1UTF\-8\s0. .Ve .PP .Vb 1 -\& 1 +\& # start a @@RXVT_NAME@@ using it: +.Ve +.PP +.Vb 1 +\& @@RXVT_NAME@@ --perl-lib $HOME -pe grab_test .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Everytime a terminal object gets created, scripts specified via the -\&\f(CW\*(C`perl\*(C'\fR resource are associated with it. +\&\f(CW\*(C`perl\*(C'\fR resource are loaded and associated with it. +.PP +Scripts are compiled in a 'use strict' and 'use utf8' environment, and +thus must be encoded as \s-1UTF\-8\s0. .PP Each script will only ever be loaded once, even in @@RXVT_NAME@@d, where scripts will be shared (But not enabled) for all terminals. @@ -252,6 +258,12 @@ code is run after this hook, and takes precedence. .el .IP "on_refresh_end \f(CW$term\fR" 4 .IX Item "on_refresh_end $term" Called just after the screen gets redrawn. See \f(CW\*(C`on_refresh_begin\*(C'\fR. +.ie n .IP "on_keyboard_command $term\fR, \f(CW$string" 4 +.el .IP "on_keyboard_command \f(CW$term\fR, \f(CW$string\fR" 4 +.IX Item "on_keyboard_command $term, $string" +Called whenever the user presses a key combination that has a +\&\f(CW\*(C`perl:string\*(C'\fR action bound to it (see description of the \fBkeysym\fR +resource in the @@RXVT_NAME@@(1) manpage). .ie n .Sh "Functions in the ""urxvt"" Package" .el .Sh "Functions in the \f(CWurxvt\fP Package" .IX Subsection "Functions in the urxvt Package" diff --git a/doc/rxvtperl.3.txt b/doc/rxvtperl.3.txt index 0a26d667..b90ba3a5 100644 --- a/doc/rxvtperl.3.txt +++ b/doc/rxvtperl.3.txt @@ -2,22 +2,23 @@ NAME rxvtperl - rxvt-unicode's embedded perl interpreter SYNOPSIS - * Put your scripts into /opt/rxvt/lib/urxvt/perl-ext/, 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 using it: + + rxvt --perl-lib $HOME -pe grab_test DESCRIPTION Everytime a terminal object gets created, scripts specified via the - "perl" resource are associated with it. + "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 rxvtd, where scripts will be shared (But not enabled) for all terminals. @@ -110,6 +111,11 @@ DESCRIPTION on_refresh_end $term Called just after the screen gets redrawn. See "on_refresh_begin". + on_keyboard_command $term, $string + Called whenever the user presses a key combination that has a + "perl:string" action bound to it (see description of the keysym + resource in the rxvt(1) manpage). + Functions in the "urxvt" Package urxvt::fatal $errormessage Fatally aborts execution with the given error message. Avoid at all diff --git a/src/urxvt.pm b/src/urxvt.pm index 34f7d5ae..a66212b5 100644 --- a/src/urxvt.pm +++ b/src/urxvt.pm @@ -1,6 +1,6 @@ =head1 NAME -rxvtperl - rxvt-unicode's embedded perl interpreter +@@RXVT_NAME@@perl - rxvt-unicode's embedded perl interpreter =head1 SYNOPSIS @@ -126,6 +126,12 @@ code is run after this hook, and takes precedence. Called just after the screen gets redrawn. See C