copy past to/from terminal
This commit is contained in:
@@ -5,6 +5,10 @@ URxvt*cursorColor: #65adc7
|
||||
URxvt*scrollBar: false
|
||||
URxvt*internalBorder: 6
|
||||
|
||||
URxvt.perl-ext-common: clipboard
|
||||
URxvt.keysym.Mod4-c: perl:clipboard:copy
|
||||
URxvt.keysym.Mod4-v: perl:clipboard:paste
|
||||
|
||||
XTerm*faceName: DejaVu Sans Mono
|
||||
XTerm*faceSize: 9
|
||||
XTerm*foreground: #7186e3
|
||||
|
||||
31
internal/rootfs/usr/lib/urxvt/perl/clipboard
Normal file
31
internal/rootfs/usr/lib/urxvt/perl/clipboard
Normal file
@@ -0,0 +1,31 @@
|
||||
#! perl -w
|
||||
|
||||
# Usage:
|
||||
# URxvt.perl-ext-common: clipboard
|
||||
# URxvt.keysym.Mod4-c: perl:clipboard:copy
|
||||
# URxvt.keysym.Mod4-v: perl:clipboard:paste
|
||||
|
||||
# consult command "xmodmap" to see what your modifier mapped into.
|
||||
|
||||
sub copy {
|
||||
my ($self) = @_;
|
||||
my $pid = open( pout, "| xsel -ib" ) or die "fork";
|
||||
print pout $self->selection;
|
||||
close(pout) or die "close";
|
||||
}
|
||||
|
||||
sub paste {
|
||||
my ($self) = @_;
|
||||
my $content = `xsel -ob` ;
|
||||
$self->tt_write ($content);
|
||||
}
|
||||
|
||||
sub on_user_command {
|
||||
my ($self, $cmd) = @_;
|
||||
if ($cmd eq "clipboard:copy") {
|
||||
$self->copy;
|
||||
}
|
||||
if ($cmd eq "clipboard:paste") {
|
||||
$self->paste;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user