… | |
… | |
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 | |
270 | =item xim-onthespot |
271 | =item xim-onthespot |
271 | |
272 | |
… | |
… | |
990 | |
991 | |
991 | sub SET_COLOR($$$) { |
992 | sub SET_COLOR($$$) { |
992 | SET_BGCOLOR (SET_FGCOLOR ($_[0], $_[1]), $_[2]) |
993 | SET_BGCOLOR (SET_FGCOLOR ($_[0], $_[1]), $_[2]) |
993 | } |
994 | } |
994 | |
995 | |
|
|
996 | sub rend2mask { |
|
|
997 | no strict 'refs'; |
|
|
998 | my ($str, $mask) = (@_, 0); |
|
|
999 | my %color = ( fg => undef, bg => undef ); |
|
|
1000 | my @failed; |
|
|
1001 | for my $spec ( split /\s+/, $str ) { |
|
|
1002 | if ( $spec =~ /^([fb]g)[_:-]?(\d+)/i ) { |
|
|
1003 | $color{lc($1)} = $2; |
|
|
1004 | } else { |
|
|
1005 | my $neg = $spec =~ s/^[-^]//; |
|
|
1006 | unless ( exists &{"RS_$spec"} ) { |
|
|
1007 | push @failed, $spec; |
|
|
1008 | next; |
|
|
1009 | } |
|
|
1010 | my $cur = &{"RS_$spec"}; |
|
|
1011 | if ( $neg ) { |
|
|
1012 | $mask &= ~$cur; |
|
|
1013 | } else { |
|
|
1014 | $mask |= $cur; |
|
|
1015 | } |
|
|
1016 | } |
|
|
1017 | } |
|
|
1018 | ($mask, @color{qw(fg bg)}, \@failed) |
|
|
1019 | } |
|
|
1020 | |
995 | # urxvt::term::extension |
1021 | # urxvt::term::extension |
996 | |
1022 | |
997 | package urxvt::term::extension; |
1023 | package urxvt::term::extension; |
998 | |
1024 | |
999 | sub enable { |
1025 | sub enable { |
… | |
… | |
1110 | sub DESTROY { |
1136 | sub DESTROY { |
1111 | $_[0][1]->stop; |
1137 | $_[0][1]->stop; |
1112 | } |
1138 | } |
1113 | |
1139 | |
1114 | sub condvar { |
1140 | sub condvar { |
1115 | bless \my $flag, urxvt::anyevent::condvar:: |
1141 | bless \my $flag, urxvt::anyevent:: |
1116 | } |
1142 | } |
1117 | |
1143 | |
1118 | sub urxvt::anyevent::condvar::broadcast { |
1144 | sub broadcast { |
1119 | ${$_[0]}++; |
1145 | ${$_[0]}++; |
1120 | } |
1146 | } |
1121 | |
1147 | |
1122 | sub urxvt::anyevent::condvar::wait { |
1148 | sub wait { |
1123 | unless (${$_[0]}) { |
1149 | unless (${$_[0]}) { |
1124 | Carp::croak "AnyEvent->condvar blocking wait unsupported in urxvt, use a non-blocking API"; |
1150 | Carp::croak "AnyEvent->condvar blocking wait unsupported in urxvt, use a non-blocking API"; |
1125 | } |
1151 | } |
|
|
1152 | } |
|
|
1153 | |
|
|
1154 | sub one_event { |
|
|
1155 | Carp::croak "AnyEvent->one_event blocking wait unsupported in urxvt, use a non-blocking API"; |
1126 | } |
1156 | } |
1127 | |
1157 | |
1128 | package urxvt::term; |
1158 | package urxvt::term; |
1129 | |
1159 | |
1130 | =head2 The C<urxvt::term> Class |
1160 | =head2 The C<urxvt::term> Class |
… | |
… | |
1950 | |
1980 | |
1951 | =cut |
1981 | =cut |
1952 | |
1982 | |
1953 | package urxvt::watcher; |
1983 | package urxvt::watcher; |
1954 | |
1984 | |
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 |
1985 | =head2 The C<urxvt::timer> Class |
1961 | |
1986 | |
1962 | This class implements timer watchers/events. Time is represented as a |
1987 | This class implements timer watchers/events. Time is represented as a |
1963 | fractional number of seconds since the epoch. Example: |
1988 | fractional number of seconds since the epoch. Example: |
1964 | |
1989 | |
… | |
… | |
2149 | http://software.schmorp.de/pkg/rxvt-unicode |
2174 | http://software.schmorp.de/pkg/rxvt-unicode |
2150 | |
2175 | |
2151 | =cut |
2176 | =cut |
2152 | |
2177 | |
2153 | 1 |
2178 | 1 |
|
|
2179 | |
|
|
2180 | # vim: sw=3: |