Hello!<br><br>I use the following perl script to copy the selected text in urxvt into the clipboard and vica versa.<br><pre class="textmate-source"><pre class="sunburst"><span class="comment comment_line comment_line_number-sign comment_line_number-sign_ruby">#! /usr/bin/perl</span><br>
<br>sub on_sel_grab {<span class="meta meta_syntax meta_syntax_ruby meta_syntax_ruby_start-block"></span><br> my <span class="variable variable_other variable_other_readwrite variable_other_readwrite_global variable_other_readwrite_global_ruby">$query</span> <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_ruby">=</span> quotemeta <span class="variable variable_other variable_other_readwrite variable_other_readwrite_global variable_other_readwrite_global_ruby">$_</span>[<span class="constant constant_numeric constant_numeric_ruby">0</span>]<span class="keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby">-</span><span class="keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby">></span>selection;<br>
<span class="variable variable_other variable_other_readwrite variable_other_readwrite_global variable_other_readwrite_global_ruby">$query</span> <span class="keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby">=~</span> s<span class="keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby">/</span>\n<span class="keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby">/</span>\\n<span class="keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby">/</span>g;<br>
<span class="variable variable_other variable_other_readwrite variable_other_readwrite_global variable_other_readwrite_global_ruby">$query</span> <span class="keyword keyword_operator keyword_operator_comparison keyword_operator_comparison_ruby">=~</span> s<span class="keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby">/</span>\r<span class="keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby">/</span>\\r<span class="keyword keyword_operator keyword_operator_arithmetic keyword_operator_arithmetic_ruby">/</span>g;<br>
<span class="meta meta_function-call meta_function-call_ruby"><span class="entity entity_name entity_name_function entity_name_function_ruby">system</span></span>( <span class="string string_quoted string_quoted_double string_quoted_double_ruby">"echo -en "</span> . <span class="variable variable_other variable_other_readwrite variable_other_readwrite_global variable_other_readwrite_global_ruby">$query</span> . <span class="string string_quoted string_quoted_double string_quoted_double_ruby">" | xsel -ibp"</span> );<br>
}<br></pre></pre><br>It works normally, but there is a situation where it can't work, but when i restart urxvt terminal, it works again. When it can't work, I experience that if I select a text or using ctrl-insert it can't copy it into the clipboard, I can't paste into the web browser e.g, or into other application. I looked for information at the side of perldoc perlipc and opening pipe, but i'm newbie in it really, please help :)<br>
<br><br clear="all"><br>Best Regards,<br>Laszlo Papp<br>