… | |
… | |
28 | can find them in /opt/rxvt/lib/urxvt/perl/. |
28 | can find them in /opt/rxvt/lib/urxvt/perl/. |
29 | |
29 | |
30 | You can activate them like this: |
30 | You can activate them like this: |
31 | |
31 | |
32 | rxvt -pe <extensionname> |
32 | rxvt -pe <extensionname> |
|
|
33 | |
|
|
34 | Or by adding them to the resource for extensions loaded by default: |
|
|
35 | |
|
|
36 | URxvt.perl-ext-common: default,automove-background,selection-autotransform |
33 | |
37 | |
34 | selection (enabled by default) |
38 | selection (enabled by default) |
35 | (More) intelligent selection. This extension tries to be more |
39 | (More) intelligent selection. This extension tries to be more |
36 | intelligent when the user extends selections (double-click and |
40 | intelligent when the user extends selections (double-click and |
37 | further clicks). Right now, it tries to select words, urls and |
41 | further clicks). Right now, it tries to select words, urls and |
… | |
… | |
143 | |
147 | |
144 | The first line tells the selection code to treat the unchanging part |
148 | The first line tells the selection code to treat the unchanging part |
145 | of every error message as a selection pattern, and the second line |
149 | of every error message as a selection pattern, and the second line |
146 | transforms the message into vi commands to load the file. |
150 | transforms the message into vi commands to load the file. |
147 | |
151 | |
|
|
152 | tabbed |
|
|
153 | This transforms the terminal into a tabbar with additional |
|
|
154 | terminals, that is, it implements what is commonly refered to as |
|
|
155 | "tabbed terminal". The topmost line displays a "[NEW]" button, |
|
|
156 | which, when clicked, will add a new tab, followed by one button per |
|
|
157 | tab. |
|
|
158 | |
|
|
159 | Clicking a button will activate that tab. Pressing Shift-Left and |
|
|
160 | Shift-Right will switch to the tab left or right of the current one. |
|
|
161 | |
148 | mark-urls |
162 | mark-urls |
149 | Uses per-line display filtering ("on_line_update") to underline urls |
163 | Uses per-line display filtering ("on_line_update") to underline urls |
150 | and make them clickable. When middle-clicked, the program specified |
164 | and make them clickable. When middle-clicked, the program specified |
151 | in the resource "urlLauncher" (default "x-www-browser") will be |
165 | in the resource "urlLauncher" (default "x-www-browser") will be |
152 | started with the URL as first argument. |
166 | started with the URL as first argument. |
… | |
… | |
260 | be called whenever the relevant event happens. |
274 | be called whenever the relevant event happens. |
261 | |
275 | |
262 | The first argument passed to them is an extension oject as described in |
276 | The first argument passed to them is an extension oject as described in |
263 | the in the "Extension Objects" section. |
277 | the in the "Extension Objects" section. |
264 | |
278 | |
265 | All of these hooks must return a boolean value. If it is true, then the |
279 | All of these hooks must return a boolean value. If any of the called |
266 | event counts as being *consumed*, and the invocation of other hooks is |
280 | hooks returns true, then the event counts as being *consumed*, and the |
267 | skipped, and the relevant action might not be carried out by the C++ |
281 | relevant action might not be carried out by the C++ code. |
268 | code. |
|
|
269 | |
282 | |
270 | *When in doubt, return a false value (preferably "()").* |
283 | *When in doubt, return a false value (preferably "()").* |
271 | |
284 | |
272 | on_init $term |
285 | on_init $term |
273 | Called after a new terminal object has been initialized, but before |
286 | Called after a new terminal object has been initialized, but before |
274 | windows are created or the command gets run. Most methods are unsafe |
287 | windows are created or the command gets run. Most methods are unsafe |
275 | to call or deliver senseless data, as terminal size and other |
288 | to call or deliver senseless data, as terminal size and other |
276 | characteristics have not yet been determined. You can safely query |
289 | characteristics have not yet been determined. You can safely query |
277 | and change resources, though. |
290 | and change resources and options, though. For many purposes the |
|
|
291 | "on_start" hook is a better place. |
|
|
292 | |
|
|
293 | on_start $term |
|
|
294 | Called at the very end of initialisation of a new terminal, just |
|
|
295 | before trying to map (display) the toplevel and returning to the |
|
|
296 | mainloop. |
|
|
297 | |
|
|
298 | on_destroy $term |
|
|
299 | Called whenever something tries to destroy terminal, before doing |
|
|
300 | anything yet. If this hook returns true, then destruction is |
|
|
301 | skipped, but this is rarely a good idea. |
278 | |
302 | |
279 | on_reset $term |
303 | on_reset $term |
280 | Called after the screen is "reset" for any reason, such as resizing |
304 | Called after the screen is "reset" for any reason, such as resizing |
281 | or control sequences. Here is where you can react on changes to |
305 | or control sequences. Here is where you can react on changes to |
282 | size-related variables. |
306 | size-related variables. |
283 | |
|
|
284 | on_start $term |
|
|
285 | Called at the very end of initialisation of a new terminal, just |
|
|
286 | before returning to the mainloop. |
|
|
287 | |
307 | |
288 | on_child_start $term, $pid |
308 | on_child_start $term, $pid |
289 | Called just after the child process has been "fork"ed. |
309 | Called just after the child process has been "fork"ed. |
290 | |
310 | |
291 | on_child_exit $term, $status |
311 | on_child_exit $term, $status |
… | |
… | |
417 | "on_key_press" additionally receives the string rxvt-unicode would |
437 | "on_key_press" additionally receives the string rxvt-unicode would |
418 | output, if any, in locale-specific encoding. |
438 | output, if any, in locale-specific encoding. |
419 | |
439 | |
420 | subwindow. |
440 | subwindow. |
421 | |
441 | |
|
|
442 | on_client_message $term, $event |
|
|
443 | on_wm_protocols $term, $event |
|
|
444 | on_wm_delete_window $term, $event |
|
|
445 | Called when various types of ClientMessage events are received (all |
|
|
446 | with format=32, WM_PROTOCOLS or WM_PROTOCOLS:WM_DELETE_WINDOW). |
|
|
447 | |
422 | Variables in the "urxvt" Package |
448 | Variables in the "urxvt" Package |
423 | $urxvt::LIBDIR |
449 | $urxvt::LIBDIR |
424 | The rxvt-unicode library directory, where, among other things, the |
450 | The rxvt-unicode library directory, where, among other things, the |
425 | perl modules and scripts are stored. |
451 | perl modules and scripts are stored. |
426 | |
452 | |
… | |
… | |
432 | The basename of the installed binaries, usually "urxvt". |
458 | The basename of the installed binaries, usually "urxvt". |
433 | |
459 | |
434 | $urxvt::TERM |
460 | $urxvt::TERM |
435 | The current terminal. This variable stores the current "urxvt::term" |
461 | The current terminal. This variable stores the current "urxvt::term" |
436 | object, whenever a callback/hook is executing. |
462 | object, whenever a callback/hook is executing. |
|
|
463 | |
|
|
464 | @urxvt::TERM_INIT |
|
|
465 | All coderefs in this array will be called as methods of the next |
|
|
466 | newly created "urxvt::term" object (during the "on_init" phase). The |
|
|
467 | array gets cleared before the codereferences that were in it are |
|
|
468 | being executed, so coderefs can push themselves onto it again if |
|
|
469 | they so desire. |
|
|
470 | |
|
|
471 | This complements to the perl-eval commandline option, but gets |
|
|
472 | executed first. |
|
|
473 | |
|
|
474 | @urxvt::TERM_EXT |
|
|
475 | Works similar to @TERM_INIT, but contains perl package/class names, |
|
|
476 | which get registered as normal extensions after calling the hooks in |
|
|
477 | @TERM_INIT but before other extensions. Gets cleared just like |
|
|
478 | @TERM_INIT. |
437 | |
479 | |
438 | Functions in the "urxvt" Package |
480 | Functions in the "urxvt" Package |
439 | urxvt::fatal $errormessage |
481 | urxvt::fatal $errormessage |
440 | Fatally aborts execution with the given error message. Avoid at all |
482 | Fatally aborts execution with the given error message. Avoid at all |
441 | costs! The only time this is acceptable is when the terminal process |
483 | costs! The only time this is acceptable is when the terminal process |
… | |
… | |
992 | Start watching for requested events on the given handle. |
1034 | Start watching for requested events on the given handle. |
993 | |
1035 | |
994 | $iow = $iow->stop |
1036 | $iow = $iow->stop |
995 | Stop watching for events on the given filehandle. |
1037 | Stop watching for events on the given filehandle. |
996 | |
1038 | |
|
|
1039 | The "urxvt::iw" Class |
|
|
1040 | This class implements idle watchers, that get called automatically when |
|
|
1041 | the process is idle. They should return as fast as possible, after doing |
|
|
1042 | some useful work. |
|
|
1043 | |
|
|
1044 | $iw = new urxvt::iw |
|
|
1045 | Create a new idle watcher object in stopped state. |
|
|
1046 | |
|
|
1047 | $iw = $iw->cb (sub { my ($iw) = @_; ... }) |
|
|
1048 | Set the callback to be called when the watcher triggers. |
|
|
1049 | |
|
|
1050 | $timer = $timer->start |
|
|
1051 | Start the watcher. |
|
|
1052 | |
|
|
1053 | $timer = $timer->stop |
|
|
1054 | Stop the watcher. |
|
|
1055 | |
|
|
1056 | The "urxvt::pw" Class |
|
|
1057 | This class implements process watchers. They create an event whenever a |
|
|
1058 | process exits, after which they stop automatically. |
|
|
1059 | |
|
|
1060 | my $pid = fork; |
|
|
1061 | ... |
|
|
1062 | $term->{pw} = urxvt::pw |
|
|
1063 | ->new |
|
|
1064 | ->start ($pid) |
|
|
1065 | ->cb (sub { |
|
|
1066 | my ($pw, $exit_status) = @_; |
|
|
1067 | ... |
|
|
1068 | }); |
|
|
1069 | |
|
|
1070 | $pw = new urxvt::pw |
|
|
1071 | Create a new process watcher in stopped state. |
|
|
1072 | |
|
|
1073 | $pw = $pw->cb (sub { my ($pw, $exit_status) = @_; ... }) |
|
|
1074 | Set the callback to be called when the timer triggers. |
|
|
1075 | |
|
|
1076 | $pw = $timer->start ($pid) |
|
|
1077 | Tells the wqtcher to start watching for process $pid. |
|
|
1078 | |
|
|
1079 | $pw = $pw->stop |
|
|
1080 | Stop the watcher. |
|
|
1081 | |
997 | ENVIRONMENT |
1082 | ENVIRONMENT |
998 | URXVT_PERL_VERBOSITY |
1083 | URXVT_PERL_VERBOSITY |
999 | This variable controls the verbosity level of the perl extension. Higher |
1084 | This variable controls the verbosity level of the perl extension. Higher |
1000 | numbers indicate more verbose output. |
1085 | numbers indicate more verbose output. |
1001 | |
1086 | |