FIX ALL CLIPBOAD !!!

This commit is contained in:
2026-03-23 01:01:26 +01:00
parent bf0a932dd1
commit ccdf514f73
2 changed files with 15 additions and 2 deletions

View File

@@ -5,11 +5,12 @@ URxvt*cursorColor: #65adc7
URxvt*scrollBar: false
URxvt*internalBorder: 6
URxvt.perl-ext-common: default,matcherclipboard
URxvt.perl-ext-common: default,clipboard
URxvt.keysym.Shift-Control-C: perl:clipboard:copy
URxvt.keysym.Mod4-c: perl:clipboard:copy
URxvt.keysym.Mod4-v: perl:clipboard:paste
URxvt.keysym.C-v: perl:clipboard:paste
URxvt.clipboard.autocopy: true
URxvt.clipboard.autocopy: false
URxvt.clipboard.copycmd: sh -c 'xsel -i -b'
URxvt.clipboard.pastecmd: sh -c 'xsel -o -b'

View File

@@ -65,6 +65,12 @@ sub paste {
my $str = `$self->{paste_cmd}`;
if ($? == 0) {
$self->tt_write($str);
if (open(CLIPBOARD, "| $self->{copy_cmd}")) {
print CLIPBOARD $str;
close(CLIPBOARD);
} else {
print STDERR "error running '$self->{copy_cmd}': $!\n";
}
} else {
print STDERR "error running '$self->{paste_cmd}': $!\n";
}
@@ -79,6 +85,12 @@ sub paste_escaped {
if ($? == 0) {
$str =~ s/([!#\$%&\*\(\) ='"\\\|\[\]`~,<>\?])/\\\1/g;
$self->tt_write($str);
if (open(CLIPBOARD, "| $self->{copy_cmd}")) {
print CLIPBOARD $str;
close(CLIPBOARD);
} else {
print STDERR "error running '$self->{copy_cmd}': $!\n";
}
} else {
print STDERR "error running '$self->{paste_cmd}': $!\n";
}