From 23591fd14fd0d2db3e43533d94bf575ec5152bca Mon Sep 17 00:00:00 2001 From: numeral Date: Wed, 5 Feb 2014 17:17:20 -0500 Subject: [PATCH] Copy URI to XA_CLIPBOARD on right click Small patch that copies the match into the default clipboard using gtk_clipboard_set_text(). Maybe consider which clipboard to use (such as PRIMARY OR SECONDARY) instead based on a config option, although that may be overkill (especially since PRIMARY is supposed to be ephemeral or something) Signed-off-by: Simon Gomizelj --- termite.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/termite.cc b/termite.cc index de0a058..e2ad185 100644 --- a/termite.cc +++ b/termite.cc @@ -923,6 +923,9 @@ gboolean button_press_cb(VteTerminal *vte, GdkEventButton *event, const config_i launch_browser(info->browser, match); g_free(match); return TRUE; + } else if(event->button == 3 && event->type == GDK_BUTTON_PRESS && match) { + GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); + gtk_clipboard_set_text(clipboard, match, -1); } } return FALSE;