From b8cbf4e7ada101858e7ccb3c7b3e0897e1915359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bert=20M=C3=BCnnich?= Date: Thu, 13 Sep 2012 21:51:25 +0200 Subject: [PATCH] clipboard: added option autocopy --- clipboard | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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; + + () +}