Created
November 15, 2013 08:42
-
-
Save gridsane/7481121 to your computer and use it in GitHub Desktop.
urxvt clipboard extension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#script to copy/paste text in URXVT | |
#copyrights ? | |
#! perl | |
sub on_sel_grab { | |
my $query = $_[0]->selection; | |
open (my $pipe,'| /usr/bin/xclip -in -selection clipboard') or die; | |
print $pipe $query; | |
close $pipe; | |
} | |
sub paste { | |
my ($self) = @_; | |
my $content = `/usr/bin/xclip -loop 1 -out -selection clipboard` ; | |
$self->tt_write ($content); | |
} | |
sub on_user_command { | |
my ($self, $cmd) = @_; | |
if ($cmd eq "clipboard:paste") { | |
$self->paste; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment