Clipboard module
This commit is contained in:
parent
58eea8d76c
commit
a634700cf3
28
Clip.pm
Normal file
28
Clip.pm
Normal file
@ -0,0 +1,28 @@
|
||||
package Clip;
|
||||
|
||||
use Clipboard;
|
||||
|
||||
sub new {
|
||||
my $class = shift;
|
||||
|
||||
my $self = { _password => shift, };
|
||||
|
||||
bless $self, $class;
|
||||
return $self;
|
||||
}
|
||||
|
||||
sub copy {
|
||||
my ($self) = @_;
|
||||
my $password = $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;
|
Loading…
Reference in New Issue
Block a user