|

楼主 |
发表于 2009-7-22 07:06:54
|
显示全部楼层
问题已解决!谢谢大家
Glad someone asked. The following code will push anything that gets selected in urxvt to both the primary selection and the clipboard. It requires xsel and perl:
#! /usr/bin/perl
sub on_sel_grab {
my $query = quotemeta $_[0]->selection;
$query =~ s/\n/\\n/g;
$query =~ s/\r/\\r/g;
system( "echo -en " . $query . " | xsel -ibp" );
}
I called it clipboard, saved it to /usr/lib/urxvt/perl, and enabled in the "urxvt*perl-ext-common:" line in ~/.Xdefaults:
Code:
urxvt*perl-ext-common: default,matcher,clipboard
It only works when copying out of urxvt though. |
|