1
0
mirror of https://github.com/alrayyes/server-dotfiles synced 2023-11-14 15:56:25 +00:00

added urxvt paste support

This commit is contained in:
Ryan 2017-04-27 20:49:01 +02:00
parent 745f6c73e0
commit c9565a8771
2 changed files with 25 additions and 0 deletions

View File

@ -57,6 +57,12 @@ URxvt.pointerBlank: true
#*background: #002b36 #*background: #002b36
*shading: 20 *shading: 20
# Enable paste support
URxvt.perl-lib: /home/alrayyes/bin/urxvt/perl
URxvt.keysym.Shift-Control-V: perl:clipboard:paste
URxvt.iso14755: False
URxvt.perl-ext-common: default,clipboard
*foreground: #657b83 *foreground: #657b83
!!*fading: 40 !!*fading: 40
*fadeColor: #002b36 *fadeColor: #002b36

19
urxvt/bin/urxvt/perl/clipboard Executable file
View File

@ -0,0 +1,19 @@
#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;
}
}