aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjason2018-07-31 16:07:17 -0600
committerjason2018-07-31 16:08:02 -0600
commit234af80b65053c4954b27e3a2ff9eb2d332dbedc (patch)
tree07f087a209af310c4c82cbd2bb444fef899d9c27
parent39a882b49ce869559329bb4b8703c7504a6276b2 (diff)
downloaddotfiles-234af80b65053c4954b27e3a2ff9eb2d332dbedc.tar.gz
dotfiles-234af80b65053c4954b27e3a2ff9eb2d332dbedc.zip
add clipboard script for urxvt
-rw-r--r--xorg/.urxvt/ext/clipboard (renamed from urxvt-clipboard)9
1 files changed, 5 insertions, 4 deletions
diff --git a/urxvt-clipboard b/xorg/.urxvt/ext/clipboard
index 3b68ccf..63c0ea2 100644
--- a/urxvt-clipboard
+++ b/xorg/.urxvt/ext/clipboard
@@ -1,10 +1,8 @@
1#! perl -w 1#!/usr/bin/perl
2# Author: Bert Muennich 2# Author: Bert Muennich
3# Website: http://www.github.com/muennich/urxvt-perls 3# Website: http://www.github.com/muennich/urxvt-perls
4# License: GPLv2 4# License: GPLv2
5 5
6# Install: cp urxvt-clipboard /usr/lib/urxvt/perl/clipboard
7
8# Use keyboard shortcuts to copy the selection to the clipboard and to paste 6# Use keyboard shortcuts to copy the selection to the clipboard and to paste
9# the clipboard contents (optionally escaping all special characters). 7# the clipboard contents (optionally escaping all special characters).
10# Requires xsel to be installed! 8# Requires xsel to be installed!
@@ -31,7 +29,9 @@
31 29
32# The use of the functions should be self-explanatory! 30# The use of the functions should be self-explanatory!
33 31
32
34use strict; 33use strict;
34use warnings;
35 35
36sub on_start { 36sub on_start {
37 my ($self) = @_; 37 my ($self) = @_;
@@ -79,7 +79,7 @@ sub paste_escaped {
79 79
80 my $str = `$self->{paste_cmd}`; 80 my $str = `$self->{paste_cmd}`;
81 if ($? == 0) { 81 if ($? == 0) {
82 $str =~ s/([!#\$%&\*\(\) ='"\\\|\[\]`~,<>\?])/\\\1/g; 82 $str =~ s/([!#\$%&\*\(\) ='"\\\|\[\]`~,<>\?])/\\$1/g;
83 $self->tt_paste($str); 83 $self->tt_paste($str);
84 } else { 84 } else {
85 print STDERR "error running '$self->{paste_cmd}': $!\n"; 85 print STDERR "error running '$self->{paste_cmd}': $!\n";
@@ -115,3 +115,4 @@ sub sel_grab {
115 115
116 () 116 ()
117} 117}
118