aboutsummaryrefslogblamecommitdiff
path: root/urxvt/clip
blob: ce698328297f66db49c9186162d081fb61662845 (plain) (tree)





















                                                            
#!/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;
}