1 | NAME |
1 | NAME |
2 | rxvtperl - rxvt-unicode's embedded perl interpreter |
2 | urxvtperl - rxvt-unicode's embedded perl interpreter |
3 | |
3 | |
4 | SYNOPSIS |
4 | SYNOPSIS |
5 | # create a file grab_test in $HOME: |
5 | # create a file grab_test in $HOME: |
6 | |
6 | |
7 | sub on_sel_grab { |
7 | sub on_sel_grab { |
8 | warn "you selected ", $_[0]->selection; |
8 | warn "you selected ", $_[0]->selection; |
9 | () |
9 | () |
10 | } |
10 | } |
11 | |
11 | |
12 | # start a rxvt using it: |
12 | # start a urxvt using it: |
13 | |
13 | |
14 | rxvt --perl-lib $HOME -pe grab_test |
14 | urxvt --perl-lib $HOME -pe grab_test |
15 | |
15 | |
16 | DESCRIPTION |
16 | DESCRIPTION |
17 | Everytime a terminal object gets created, extension scripts specified |
17 | Everytime a terminal object gets created, extension scripts specified |
18 | via the "perl" resource are loaded and associated with it. |
18 | via the "perl" resource are loaded and associated with it. |
19 | |
19 | |
20 | Scripts are compiled in a 'use strict' and 'use utf8' environment, and |
20 | Scripts are compiled in a 'use strict' and 'use utf8' environment, and |
21 | thus must be encoded as UTF-8. |
21 | thus must be encoded as UTF-8. |
22 | |
22 | |
23 | Each script will only ever be loaded once, even in rxvtd, where scripts |
23 | Each script will only ever be loaded once, even in urxvtd, where scripts |
24 | will be shared (but not enabled) for all terminals. |
24 | will be shared (but not enabled) for all terminals. |
25 | |
25 | |
26 | PREPACKAGED EXTENSIONS |
26 | PREPACKAGED EXTENSIONS |
27 | This section describes the extensions delivered with this release. You |
27 | This section describes the extensions delivered with this release. You |
28 | can find them in /opt/rxvt/lib/urxvt/perl/. |
28 | can find them in /usr/local/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 | urxvt -pe <extensionname> |
33 | |
33 | |
34 | selection (enabled by default) |
34 | selection (enabled by default) |
35 | (More) intelligent selection. This extension tries to be more |
35 | (More) intelligent selection. This extension tries to be more |
36 | intelligent when the user extends selections (double-click and |
36 | intelligent when the user extends selections (double-click and |
37 | further clicks). Right now, it tries to select words, urls and |
37 | further clicks). Right now, it tries to select words, urls and |
… | |
… | |
103 | |
103 | |
104 | For example, the following will transform selections of the form |
104 | For example, the following will transform selections of the form |
105 | "filename:number", often seen in compiler messages, into "vi |
105 | "filename:number", often seen in compiler messages, into "vi |
106 | +$filename $word": |
106 | +$filename $word": |
107 | |
107 | |
108 | URxvt.selection-autotransform.0: s/^(\\S+):(\\d+):?$/vi +$2 \\Q$1\\E\\x0d/ |
108 | URxvt.selection-autotransform.0: s/^([^:[:space:]]+):(\\d+):?$/vi +$2 \\Q$1\\E\\x0d/ |
109 | |
109 | |
110 | And this example matches the same,but replaces it with vi-commands |
110 | And this example matches the same,but replaces it with vi-commands |
111 | you can paste directly into your (vi :) editor: |
111 | you can paste directly into your (vi :) editor: |
112 | |
112 | |
113 | URxvt.selection-autotransform.0: s/^(S+):(d+):?$/\\x1b:e \\Q$1\\E\\x0d:$2\\x0d/ |
113 | URxvt.selection-autotransform.0: s/^([^:[:space:]]+(\\d+):?$/\\x1b:e \\Q$1\\E\\x0d:$2\\x0d/ |
114 | |
114 | |
115 | Of course, this can be modified to suit your needs and your editor |
115 | Of course, this can be modified to suit your needs and your editor |
116 | :) |
116 | :) |
117 | |
117 | |
118 | To expand the example above to typical perl error messages ("XXX at |
118 | To expand the example above to typical perl error messages ("XXX at |
… | |
… | |
318 | Called just after the screen gets redrawn. See "on_refresh_begin". |
318 | Called just after the screen gets redrawn. See "on_refresh_begin". |
319 | |
319 | |
320 | on_keyboard_command $term, $string |
320 | on_keyboard_command $term, $string |
321 | Called whenever the user presses a key combination that has a |
321 | Called whenever the user presses a key combination that has a |
322 | "perl:string" action bound to it (see description of the keysym |
322 | "perl:string" action bound to it (see description of the keysym |
323 | resource in the rxvt(1) manpage). |
323 | resource in the urxvt(1) manpage). |
|
|
324 | |
|
|
325 | on_x_event $term, $event |
|
|
326 | Called on every X event received on the vt window (and possibly |
|
|
327 | other windows). Should only be used as a last resort. Most event |
|
|
328 | structure members are not passed. |
324 | |
329 | |
325 | on_focus_in $term |
330 | on_focus_in $term |
326 | Called whenever the window gets the keyboard focus, before |
331 | Called whenever the window gets the keyboard focus, before |
327 | rxvt-unicode does focus in processing. |
332 | rxvt-unicode does focus in processing. |
328 | |
333 | |
… | |
… | |
392 | |
397 | |
393 | urxvt::CurrentTime |
398 | urxvt::CurrentTime |
394 | urxvt::ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, |
399 | urxvt::ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, |
395 | Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask, Button4Mask, |
400 | Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask, Button4Mask, |
396 | Button5Mask, AnyModifier |
401 | Button5Mask, AnyModifier |
|
|
402 | urxvt::NoEventMask, KeyPressMask, KeyReleaseMask, ButtonPressMask, |
|
|
403 | ButtonReleaseMask, EnterWindowMask, LeaveWindowMask, PointerMotionMask, |
|
|
404 | PointerMotionHintMask, Button1MotionMask, Button2MotionMask, |
|
|
405 | Button3MotionMask, Button4MotionMask, Button5MotionMask, |
|
|
406 | ButtonMotionMask, KeymapStateMask, ExposureMask, VisibilityChangeMask, |
|
|
407 | StructureNotifyMask, ResizeRedirectMask, SubstructureNotifyMask, |
|
|
408 | SubstructureRedirectMask, FocusChangeMask, PropertyChangeMask, |
|
|
409 | ColormapChangeMask, OwnerGrabButtonMask |
|
|
410 | urxvt::KeyPress, KeyRelease, ButtonPress, ButtonRelease, MotionNotify, |
|
|
411 | EnterNotify, LeaveNotify, FocusIn, FocusOut, KeymapNotify, Expose, |
|
|
412 | GraphicsExpose, NoExpose, VisibilityNotify, CreateNotify, DestroyNotify, |
|
|
413 | UnmapNotify, MapNotify, MapRequest, ReparentNotify, ConfigureNotify, |
|
|
414 | ConfigureRequest, GravityNotify, ResizeRequest, CirculateNotify, |
|
|
415 | CirculateRequest, PropertyNotify, SelectionClear, SelectionRequest, |
|
|
416 | SelectionNotify, ColormapNotify, ClientMessage, MappingNotify |
397 | Various constants for use in X calls and event processing. |
417 | Various constants for use in X calls and event processing. |
398 | |
418 | |
399 | RENDITION |
419 | RENDITION |
400 | Rendition bitsets contain information about colour, font, font styles |
420 | Rendition bitsets contain information about colour, font, font styles |
401 | and similar information for each screen cell. |
421 | and similar information for each screen cell. |
… | |
… | |
454 | initialise perl, and the terminal object otherwise. The "init" and |
474 | initialise perl, and the terminal object otherwise. The "init" and |
455 | "start" hooks will be called during this call. |
475 | "start" hooks will be called during this call. |
456 | |
476 | |
457 | $term->destroy |
477 | $term->destroy |
458 | Destroy the terminal object (close the window, free resources etc.). |
478 | Destroy the terminal object (close the window, free resources etc.). |
459 | Please note that rxvt will not exit as long as any event watchers |
479 | Please note that urxvt will not exit as long as any event watchers |
460 | (timers, io watchers) are still active. |
480 | (timers, io watchers) are still active. |
461 | |
481 | |
462 | $isset = $term->option ($optval[, $set]) |
482 | $isset = $term->option ($optval[, $set]) |
463 | Returns true if the option specified by $optval is enabled, and |
483 | Returns true if the option specified by $optval is enabled, and |
464 | optionally change it. All option values are stored by name in the |
484 | optionally change it. All option values are stored by name in the |
… | |
… | |
519 | there is only one resource database per display, and later |
539 | there is only one resource database per display, and later |
520 | invocations might return the wrong resources. |
540 | invocations might return the wrong resources. |
521 | |
541 | |
522 | $success = $term->parse_keysym ($keysym_spec, $command_string) |
542 | $success = $term->parse_keysym ($keysym_spec, $command_string) |
523 | Adds a keymap translation exactly as specified via a resource. See |
543 | Adds a keymap translation exactly as specified via a resource. See |
524 | the "keysym" resource in the rxvt(1) manpage. |
544 | the "keysym" resource in the urxvt(1) manpage. |
525 | |
545 | |
526 | $rend = $term->rstyle ([$new_rstyle]) |
546 | $rend = $term->rstyle ([$new_rstyle]) |
527 | Return and optionally change the current rendition. Text that is |
547 | Return and optionally change the current rendition. Text that is |
528 | output by the terminal application will use this style. |
548 | output by the terminal application will use this style. |
529 | |
549 | |
… | |
… | |
648 | $windowid = $term->parent |
668 | $windowid = $term->parent |
649 | Return the window id of the toplevel window. |
669 | Return the window id of the toplevel window. |
650 | |
670 | |
651 | $windowid = $term->vt |
671 | $windowid = $term->vt |
652 | Return the window id of the terminal window. |
672 | Return the window id of the terminal window. |
|
|
673 | |
|
|
674 | $term->vt_emask_add ($x_event_mask) |
|
|
675 | Adds the specified events to the vt event mask. Useful e.g. when you |
|
|
676 | want to receive pointer events all the times: |
|
|
677 | |
|
|
678 | $term->vt_emask_add (urxvt::PointerMotionMask); |
653 | |
679 | |
654 | $window_width = $term->width |
680 | $window_width = $term->width |
655 | $window_height = $term->height |
681 | $window_height = $term->height |
656 | $font_width = $term->fwidth |
682 | $font_width = $term->fwidth |
657 | $font_height = $term->fheight |
683 | $font_height = $term->fheight |