diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2014-04-26 22:42:30 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2014-04-26 22:42:30 +1200 |
commit | deee38454aed9bffd270f2ec8a4bcae6d34bc398 (patch) | |
tree | df9a9fa0b8a21ecc8097ea247b25606de5fed32c /urxvt/clip | |
parent | Strip trailing whitespace with <leader>x (diff) | |
download | dotfiles-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/clip | 22 |
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; +} + |