aboutsummaryrefslogtreecommitdiff
path: root/rxvt/.urxvt/ext/selection-to-clipboard
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@chimrod.com>2017-02-25 17:16:58 +0100
committerSébastien Dailly <sebastien@chimrod.com>2017-02-25 17:16:58 +0100
commit0c371663f5bb5ea6f3e12318e9321bb0815e24a5 (patch)
treeb3ee3e4f743a0543985ba329455449f8a602f76c /rxvt/.urxvt/ext/selection-to-clipboard
First commit
Diffstat (limited to 'rxvt/.urxvt/ext/selection-to-clipboard')
-rw-r--r--rxvt/.urxvt/ext/selection-to-clipboard27
1 files changed, 27 insertions, 0 deletions
diff --git a/rxvt/.urxvt/ext/selection-to-clipboard b/rxvt/.urxvt/ext/selection-to-clipboard
new file mode 100644
index 0000000..0431694
--- /dev/null
+++ b/rxvt/.urxvt/ext/selection-to-clipboard
@@ -0,0 +1,27 @@
+#! perl -w
+
+=head1 NAME
+
+selection-to-clipboard - copy the selection to the clipboard each time a selection is made
+
+=head1 SYNOPSIS
+
+ urxvt -pe selection-to-clipboard
+
+=head1 DESCRIPTION
+
+This very simple extension copies the selection to the clipboard every
+time a selection is made. This, in effect, synchronises the clipboard with
+the selection for selections done by rxvt-unicode.
+
+=cut
+
+sub on_sel_grab {
+ my ($self, $time) = @_;
+
+ $self->selection ($self->selection, 1);
+ $self->selection_grab ($time, 1);
+
+ ()
+}
+