… | |
… | |
240 | URxvt.tabbed.tab-bg: <colour-index, default 1> |
240 | URxvt.tabbed.tab-bg: <colour-index, default 1> |
241 | |
241 | |
242 | See I<COLOR AND GRAPHICS> in the @@RXVT_NAME@@(1) manpage for valid |
242 | See I<COLOR AND GRAPHICS> in the @@RXVT_NAME@@(1) manpage for valid |
243 | indices. |
243 | indices. |
244 | |
244 | |
245 | =item mark-urls |
245 | =item matcher |
246 | |
246 | |
247 | Uses per-line display filtering (C<on_line_update>) to underline urls and |
247 | Uses per-line display filtering (C<on_line_update>) to underline text |
248 | make them clickable. When middle-clicked, the program specified in the |
248 | matching a certain pattern and make it clickable. When clicked with the |
249 | resource C<urlLauncher> (default C<x-www-browser>) will be started with |
249 | mouse button specified in the C<matcher.button> resource (default 2, or |
250 | the URL as first argument. |
250 | middle), the program specified in the C<matcher.launcher> resource |
|
|
251 | (default, the C<urlLauncher> resource, C<sensible-browser>) will be started |
|
|
252 | with the matched text as first argument. The default configuration is |
|
|
253 | suitable for matching URLs and launching a web browser, like the |
|
|
254 | former "mark-urls" extension. |
|
|
255 | |
|
|
256 | The default pattern to match URLs can be overridden with the |
|
|
257 | C<matcher.pattern.0> resource, and additional patterns can be specified |
|
|
258 | with numbered patterns, in a manner similar to the "selection" extension. |
|
|
259 | The launcher can also be overridden on a per-pattern basis. |
|
|
260 | |
|
|
261 | Example configuration: |
|
|
262 | |
|
|
263 | URxvt.perl-ext: default,matcher |
|
|
264 | URxvt.urlLauncher: sensible-browser |
|
|
265 | URxvt.keysym.C-Delete: perl:matcher |
|
|
266 | URxvt.matcher.button: 1 |
|
|
267 | URxvt.matcher.pattern.1: \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-] |
|
|
268 | URxvt.matcher.pattern.2: \\B(/\\S+?):(\\d+)(?=:|$) |
|
|
269 | URxvt.matcher.launcher.2: gvim +$2 $1 |
251 | |
270 | |
252 | =item xim-onthespot |
271 | =item xim-onthespot |
253 | |
272 | |
254 | This (experimental) perl extension implements OnTheSpot editing. It does |
273 | This (experimental) perl extension implements OnTheSpot editing. It does |
255 | not work perfectly, and some input methods don't seem to work well with |
274 | not work perfectly, and some input methods don't seem to work well with |
… | |
… | |
287 | same effect as pseudo transparency with a custom pixmap. No scaling is |
306 | same effect as pseudo transparency with a custom pixmap. No scaling is |
288 | supported in this mode. Example: |
307 | supported in this mode. Example: |
289 | |
308 | |
290 | @@RXVT_NAME@@ -pixmap background.xpm -pe automove-background |
309 | @@RXVT_NAME@@ -pixmap background.xpm -pe automove-background |
291 | |
310 | |
|
|
311 | L<http://wiki.archlinux.org/index.php/Perl_Background_Rotation/Extensions> |
|
|
312 | shows how this extension can be used to implement an automatically blurred |
|
|
313 | transparent background. |
|
|
314 | |
292 | =item block-graphics-to-ascii |
315 | =item block-graphics-to-ascii |
293 | |
316 | |
294 | A not very useful example of filtering all text output to the terminal |
317 | A not very useful example of filtering all text output to the terminal |
295 | by replacing all line-drawing characters (U+2500 .. U+259F) by a |
318 | by replacing all line-drawing characters (U+2500 .. U+259F) by a |
296 | similar-looking ascii character. |
319 | similar-looking ascii character. |
… | |
… | |
345 | After a successful upload the selection will be replaced by the text given |
368 | After a successful upload the selection will be replaced by the text given |
346 | in the C<selection-pastebin-url> resource (again, the % is the placeholder |
369 | in the C<selection-pastebin-url> resource (again, the % is the placeholder |
347 | for the filename): |
370 | for the filename): |
348 | |
371 | |
349 | URxvt.selection-pastebin.url: http://www.ta-sa.org/files/txt/% |
372 | URxvt.selection-pastebin.url: http://www.ta-sa.org/files/txt/% |
|
|
373 | |
|
|
374 | I<Note to xrdb users:> xrdb uses the C preprocessor, which might interpret |
|
|
375 | the double C</> characters as comment start. Use C<\057\057> instead, |
|
|
376 | which works regardless of wether xrdb is used to parse the resource file |
|
|
377 | or not. |
350 | |
378 | |
351 | =item example-refresh-hooks |
379 | =item example-refresh-hooks |
352 | |
380 | |
353 | Displays a very simple digital clock in the upper right corner of the |
381 | Displays a very simple digital clock in the upper right corner of the |
354 | window. Illustrates overwriting the refresh callbacks to create your own |
382 | window. Illustrates overwriting the refresh callbacks to create your own |
… | |
… | |
395 | =back |
423 | =back |
396 | |
424 | |
397 | =head2 Extension Objects |
425 | =head2 Extension Objects |
398 | |
426 | |
399 | Every perl extension is a perl class. A separate perl object is created |
427 | Every perl extension is a perl class. A separate perl object is created |
400 | for each terminal and each extension and passed as the first parameter to |
428 | for each terminal, and each terminal has its own set of extenion objects, |
401 | hooks. So extensions can use their C<$self> object without having to think |
429 | which are passed as the first parameter to hooks. So extensions can use |
402 | about other extensions, with the exception of methods and members that |
430 | their C<$self> object without having to think about clashes with other |
|
|
431 | extensions or other terminals, with the exception of methods and members |
403 | begin with an underscore character C<_>: these are reserved for internal |
432 | that begin with an underscore character C<_>: these are reserved for |
404 | use. |
433 | internal use. |
405 | |
434 | |
406 | Although it isn't a C<urxvt::term> object, you can call all methods of the |
435 | Although it isn't a C<urxvt::term> object, you can call all methods of the |
407 | C<urxvt::term> class on this object. |
436 | C<urxvt::term> class on this object. |
408 | |
437 | |
409 | It has the following methods and data members: |
438 | It has the following methods and data members: |
… | |
… | |
966 | |
995 | |
967 | sub SET_COLOR($$$) { |
996 | sub SET_COLOR($$$) { |
968 | SET_BGCOLOR (SET_FGCOLOR ($_[0], $_[1]), $_[2]) |
997 | SET_BGCOLOR (SET_FGCOLOR ($_[0], $_[1]), $_[2]) |
969 | } |
998 | } |
970 | |
999 | |
|
|
1000 | sub rend2mask { |
|
|
1001 | no strict 'refs'; |
|
|
1002 | my ($str, $mask) = (@_, 0); |
|
|
1003 | my %color = ( fg => undef, bg => undef ); |
|
|
1004 | my @failed; |
|
|
1005 | for my $spec ( split /\s+/, $str ) { |
|
|
1006 | if ( $spec =~ /^([fb]g)[_:-]?(\d+)/i ) { |
|
|
1007 | $color{lc($1)} = $2; |
|
|
1008 | } else { |
|
|
1009 | my $neg = $spec =~ s/^[-^]//; |
|
|
1010 | unless ( exists &{"RS_$spec"} ) { |
|
|
1011 | push @failed, $spec; |
|
|
1012 | next; |
|
|
1013 | } |
|
|
1014 | my $cur = &{"RS_$spec"}; |
|
|
1015 | if ( $neg ) { |
|
|
1016 | $mask &= ~$cur; |
|
|
1017 | } else { |
|
|
1018 | $mask |= $cur; |
|
|
1019 | } |
|
|
1020 | } |
|
|
1021 | } |
|
|
1022 | ($mask, @color{qw(fg bg)}, \@failed) |
|
|
1023 | } |
|
|
1024 | |
971 | # urxvt::term::extension |
1025 | # urxvt::term::extension |
972 | |
1026 | |
973 | package urxvt::term::extension; |
1027 | package urxvt::term::extension; |
974 | |
1028 | |
975 | sub enable { |
1029 | sub enable { |
… | |
… | |
1086 | sub DESTROY { |
1140 | sub DESTROY { |
1087 | $_[0][1]->stop; |
1141 | $_[0][1]->stop; |
1088 | } |
1142 | } |
1089 | |
1143 | |
1090 | sub condvar { |
1144 | sub condvar { |
1091 | bless \my $flag, urxvt::anyevent::condvar:: |
1145 | bless \my $flag, urxvt::anyevent:: |
1092 | } |
1146 | } |
1093 | |
1147 | |
1094 | sub urxvt::anyevent::condvar::broadcast { |
1148 | sub broadcast { |
1095 | ${$_[0]}++; |
1149 | ${$_[0]}++; |
1096 | } |
1150 | } |
1097 | |
1151 | |
1098 | sub urxvt::anyevent::condvar::wait { |
1152 | sub wait { |
1099 | unless (${$_[0]}) { |
1153 | unless (${$_[0]}) { |
1100 | Carp::croak "AnyEvent->condvar blocking wait unsupported in urxvt, use a non-blocking API"; |
1154 | Carp::croak "AnyEvent->condvar blocking wait unsupported in urxvt, use a non-blocking API"; |
1101 | } |
1155 | } |
|
|
1156 | } |
|
|
1157 | |
|
|
1158 | sub one_event { |
|
|
1159 | Carp::croak "AnyEvent->one_event blocking wait unsupported in urxvt, use a non-blocking API"; |
1102 | } |
1160 | } |
1103 | |
1161 | |
1104 | package urxvt::term; |
1162 | package urxvt::term; |
1105 | |
1163 | |
1106 | =head2 The C<urxvt::term> Class |
1164 | =head2 The C<urxvt::term> Class |
… | |
… | |
1926 | |
1984 | |
1927 | =cut |
1985 | =cut |
1928 | |
1986 | |
1929 | package urxvt::watcher; |
1987 | package urxvt::watcher; |
1930 | |
1988 | |
1931 | @urxvt::timer::ISA = __PACKAGE__; |
|
|
1932 | @urxvt::iow::ISA = __PACKAGE__; |
|
|
1933 | @urxvt::pw::ISA = __PACKAGE__; |
|
|
1934 | @urxvt::iw::ISA = __PACKAGE__; |
|
|
1935 | |
|
|
1936 | =head2 The C<urxvt::timer> Class |
1989 | =head2 The C<urxvt::timer> Class |
1937 | |
1990 | |
1938 | This class implements timer watchers/events. Time is represented as a |
1991 | This class implements timer watchers/events. Time is represented as a |
1939 | fractional number of seconds since the epoch. Example: |
1992 | fractional number of seconds since the epoch. Example: |
1940 | |
1993 | |
… | |
… | |
2125 | http://software.schmorp.de/pkg/rxvt-unicode |
2178 | http://software.schmorp.de/pkg/rxvt-unicode |
2126 | |
2179 | |
2127 | =cut |
2180 | =cut |
2128 | |
2181 | |
2129 | 1 |
2182 | 1 |
|
|
2183 | |
|
|
2184 | # vim: sw=3: |