PM/ClipPass.pm
2014-05-06 00:40:26 +04:00

28 lines
427 B
Perl

package ClipPass;
use Clipboard;
sub new {
my $class = shift;
my $self = {};
bless $self, $class;
return $self;
}
sub copy {
my ( $self, $password ) = @_;
if ( 'Clipboard::Xclip' eq $Clipboard::driver ) {
no warnings 'redefine';
*Clipboard::Xclip::all_selections = sub {
qw(clipboard primary buffer secondary);
};
}
Clipboard->copy("$password");
}
1;