mirror of
https://github.com/alrayyes/server-dotfiles
synced 2023-11-14 15:56:25 +00:00
20 lines
465 B
Plaintext
Executable File
20 lines
465 B
Plaintext
Executable File
#script to copy/paste text in URXVT
|
|
#! 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;
|
|
}
|
|
}
|