LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1898|回复: 4

请教大家,在urxvt中怎么选定一部分文本,粘贴到其它程序(例如Firefox)中(问题解决了!)

[复制链接]
发表于 2009-7-20 09:14:25 | 显示全部楼层 |阅读模式
我在urxvt中用Ctrl+Insert可以,到其它程序就不可以了
发表于 2009-7-20 10:30:41 | 显示全部楼层
选中,再中键黏贴行不?
我在xterm下这么干的
回复 支持 反对

使用道具 举报

发表于 2009-7-20 11:50:35 | 显示全部楼层
Post by zhouhaiming;2007759
我在urxvt中用Ctrl+Insert可以,到其它程序就不可以了


如果没有中键,可以同时按住左右键,跟中键一样的效果
回复 支持 反对

使用道具 举报

 楼主| 发表于 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.
回复 支持 反对

使用道具 举报

发表于 2009-7-22 22:40:05 | 显示全部楼层
这个留下了,学习~~~~这个方法不错
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表