Re: [dev] [surf] copying to clipboard instead of primary

From: Caio Barros <caio.barros_AT_gmail.com>
Date: Wed, 9 Jan 2019 09:53:41 -0200

Em ter, 8 de jan de 2019 às 20:34, Robin Pedersen
<robin.a.t.pedersen_AT_gmail.com> escreveu:
> Does this help?
> https://developer.gnome.org/gdk3/stable/gdk3-Selections.html
> https://git.suckless.org/surf/file/surf.c.html#l1817
>
> Regards Robin.

Hum, yes! It seems that this is the right track. I just changed the
definition of *clipboard* in surf.c and now Ctrl-y seems to copy the
current URL to the clipboard as I wanted. The only thing I'm missing
now is to copy texto selection to clipboard. It seems that the
definition of *clipcopy* and *clippaste* in st can help, although I'm
not sure yet how to implement it in surf.
http://git.suckless.org/st/file/x.c.html

For now here is my diff:

diff --git a/surf.c b/surf.c
index d48fbc9..a3f141c 100644
--- a/surf.c
+++ b/surf.c
_AT_@ -1816,11 +1816,11 @@ clipboard(Client *c, const Arg *a)
 {
        if (a-&gt;i) { /* load clipboard uri */
                gtk_clipboard_request_text(gtk_clipboard_get(
- GDK_SELECTION_PRIMARY),
+ GDK_SELECTION_CLIPBOARD),
                                           pasteuri, c);
        } else { /* copy uri */
                gtk_clipboard_set_text(gtk_clipboard_get(
- GDK_SELECTION_PRIMARY), c-&gt;targeturi
+ GDK_SELECTION_CLIPBOARD), c-&gt;targeturi
                                       ? c-&gt;targeturi : geturi(c), -1);
        }
 }


Em ter, 8 de jan de 2019 às 20:55, Szpak <szpak_AT_reakcja.org> escreveu:
> For WebInspector try 'surf -N'.
>
> Regards,
> Marcin Szpak

Awesome. Didn't notice that I had to start surf with the -N flag. Thank you!

Caio

Received on Wed Jan 09 2019 - 12:53:41 CET

This archive was generated by hypermail 2.3.0 : Wed Jan 09 2019 - 13:00:07 CET