aboutsummaryrefslogtreecommitdiff
path: root/urxvt/clip
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-04-26 22:42:30 +1200
committerTom Ryder <tom@sanctum.geek.nz>2014-04-26 22:42:30 +1200
commitdeee38454aed9bffd270f2ec8a4bcae6d34bc398 (patch)
treedf9a9fa0b8a21ecc8097ea247b25606de5fed32c /urxvt/clip
parentStrip trailing whitespace with <leader>x (diff)
downloaddotfiles-deee38454aed9bffd270f2ec8a4bcae6d34bc398.tar.gz
dotfiles-deee38454aed9bffd270f2ec8a4bcae6d34bc398.zip
Replace clipboard urxvt with abbreviated script
I didn't need the keybindings or the paste functionality, just the autocopy feature.
Diffstat (limited to 'urxvt/clip')
-rw-r--r--urxvt/clip22
1 files changed, 22 insertions, 0 deletions
diff --git a/urxvt/clip b/urxvt/clip
new file mode 100644
index 00000000..ce698328
--- /dev/null
+++ b/urxvt/clip
@@ -0,0 +1,22 @@
+#!/usr/bin/env perl
+
+# Copy PRIMARY selections to the clipboard too with xsel(1).
+
+use strict;
+use warnings;
+
+sub on_start {
+ my ($self) = @_;
+ $self->enable( sel_grab => \&clip );
+ return;
+}
+
+sub clip {
+ my ($self) = @_;
+ if ( open CLIPBOARD, '| xsel -ib' ) {
+ print CLIPBOARD $self->selection();
+ close CLIPBOARD;
+ }
+ return;
+}
+