diff --git a/clipboard b/clipboard index 1709db1..a21f4c8 100644 --- a/clipboard +++ b/clipboard @@ -34,6 +34,10 @@ sub on_start { $self->{copy_cmd} = $self->x_resource('clipboard.copycmd') || 'xsel -ib'; $self->{paste_cmd} = $self->x_resource('clipboard.pastecmd') || 'xsel -ob'; + if ($self->x_resource('clipboard.autocopy' eq 'true') { + $self->enable(sel_grab => \&sel_grab); + } + () } @@ -92,3 +96,11 @@ sub on_user_command { () } + +sub sel_grab { + my ($self) = @_; + + $self->copy; + + () +}