… | |
… | |
260 | |
260 | |
261 | Example configuration: |
261 | Example configuration: |
262 | |
262 | |
263 | URxvt.perl-ext: default,matcher |
263 | URxvt.perl-ext: default,matcher |
264 | URxvt.urlLauncher: sensible-browser |
264 | URxvt.urlLauncher: sensible-browser |
|
|
265 | URxvt.keysym.C-Delete: perl:matcher |
265 | URxvt.matcher.button: 1 |
266 | URxvt.matcher.button: 1 |
266 | URxvt.matcher.pattern.1: \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-] |
267 | URxvt.matcher.pattern.1: \\bwww\\.[\\w-]+\\.[\\w./?&@#-]*[\\w/-] |
267 | URxvt.matcher.pattern.2: \\B(/\\S+?):(\\d+)(?=:|$) |
268 | URxvt.matcher.pattern.2: \\B(/\\S+?):(\\d+)(?=:|$) |
268 | URxvt.matcher.launcher.2: gvim +$2 $1 |
269 | URxvt.matcher.launcher.2: gvim +$2 $1 |
269 | |
270 | |
… | |
… | |
304 | background pixmap offset to the window position, in effect creating the |
305 | background pixmap offset to the window position, in effect creating the |
305 | 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 |
306 | supported in this mode. Example: |
307 | supported in this mode. Example: |
307 | |
308 | |
308 | @@RXVT_NAME@@ -pixmap background.xpm -pe automove-background |
309 | @@RXVT_NAME@@ -pixmap background.xpm -pe automove-background |
|
|
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. |
309 | |
314 | |
310 | =item block-graphics-to-ascii |
315 | =item block-graphics-to-ascii |
311 | |
316 | |
312 | 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 |
313 | 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 |
… | |
… | |
990 | |
995 | |
991 | sub SET_COLOR($$$) { |
996 | sub SET_COLOR($$$) { |
992 | SET_BGCOLOR (SET_FGCOLOR ($_[0], $_[1]), $_[2]) |
997 | SET_BGCOLOR (SET_FGCOLOR ($_[0], $_[1]), $_[2]) |
993 | } |
998 | } |
994 | |
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 | |
995 | # urxvt::term::extension |
1025 | # urxvt::term::extension |
996 | |
1026 | |
997 | package urxvt::term::extension; |
1027 | package urxvt::term::extension; |
998 | |
1028 | |
999 | sub enable { |
1029 | sub enable { |
… | |
… | |
1110 | sub DESTROY { |
1140 | sub DESTROY { |
1111 | $_[0][1]->stop; |
1141 | $_[0][1]->stop; |
1112 | } |
1142 | } |
1113 | |
1143 | |
1114 | sub condvar { |
1144 | sub condvar { |
1115 | bless \my $flag, urxvt::anyevent::condvar:: |
1145 | bless \my $flag, urxvt::anyevent:: |
1116 | } |
1146 | } |
1117 | |
1147 | |
1118 | sub urxvt::anyevent::condvar::broadcast { |
1148 | sub broadcast { |
1119 | ${$_[0]}++; |
1149 | ${$_[0]}++; |
1120 | } |
1150 | } |
1121 | |
1151 | |
1122 | sub urxvt::anyevent::condvar::wait { |
1152 | sub wait { |
1123 | unless (${$_[0]}) { |
1153 | unless (${$_[0]}) { |
1124 | 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"; |
1125 | } |
1155 | } |
|
|
1156 | } |
|
|
1157 | |
|
|
1158 | sub one_event { |
|
|
1159 | Carp::croak "AnyEvent->one_event blocking wait unsupported in urxvt, use a non-blocking API"; |
1126 | } |
1160 | } |
1127 | |
1161 | |
1128 | package urxvt::term; |
1162 | package urxvt::term; |
1129 | |
1163 | |
1130 | =head2 The C<urxvt::term> Class |
1164 | =head2 The C<urxvt::term> Class |
… | |
… | |
1950 | |
1984 | |
1951 | =cut |
1985 | =cut |
1952 | |
1986 | |
1953 | package urxvt::watcher; |
1987 | package urxvt::watcher; |
1954 | |
1988 | |
1955 | @urxvt::timer::ISA = __PACKAGE__; |
|
|
1956 | @urxvt::iow::ISA = __PACKAGE__; |
|
|
1957 | @urxvt::pw::ISA = __PACKAGE__; |
|
|
1958 | @urxvt::iw::ISA = __PACKAGE__; |
|
|
1959 | |
|
|
1960 | =head2 The C<urxvt::timer> Class |
1989 | =head2 The C<urxvt::timer> Class |
1961 | |
1990 | |
1962 | This class implements timer watchers/events. Time is represented as a |
1991 | This class implements timer watchers/events. Time is represented as a |
1963 | fractional number of seconds since the epoch. Example: |
1992 | fractional number of seconds since the epoch. Example: |
1964 | |
1993 | |
… | |
… | |
2149 | http://software.schmorp.de/pkg/rxvt-unicode |
2178 | http://software.schmorp.de/pkg/rxvt-unicode |
2150 | |
2179 | |
2151 | =cut |
2180 | =cut |
2152 | |
2181 | |
2153 | 1 |
2182 | 1 |
|
|
2183 | |
|
|
2184 | # vim: sw=3: |