aboutsummaryrefslogtreecommitdiff
path: root/urxvt/ext
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-04-26 23:18:44 +1200
committerTom Ryder <tom@sanctum.geek.nz>2014-04-26 23:18:44 +1200
commite38108db214727499bd59ec02aa06c5f08668392 (patch)
tree065c1314aa1debdf4debee60823ed5e57a1307e4 /urxvt/ext
parentAdd tmux vertical separator to URxvt.cutchars (diff)
downloaddotfiles-e38108db214727499bd59ec02aa06c5f08668392.tar.gz
dotfiles-e38108db214727499bd59ec02aa06c5f08668392.zip
Remove Urxvt.perl-lib definition
I didn't read the manpage. It turns out that urxvt will search $HOME/.urxvt/ext by default for its extensions, so I don't need to specify a path here (much less a fixed string rather than a variable).
Diffstat (limited to 'urxvt/ext')
-rw-r--r--urxvt/ext/clip22
1 files changed, 22 insertions, 0 deletions
diff --git a/urxvt/ext/clip b/urxvt/ext/clip
new file mode 100644
index 00000000..ce698328
--- /dev/null
+++ b/urxvt/ext/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;
+}
+