sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

commit 43e2a56027e55c571e0fa43467ba779b573f1570
parent e72c646fad44d429a42f948d399b9557840177ae
Author: lieven moors <lievenmoors@gmail.com>
Date:   Sat, 14 Nov 2015 19:05:54 +0100

Adapted the bookmarks patch to apply against current tip.

Diffstat:
Asurf.suckless.org/patches/surf-tip-bookmarks.diff | 41+++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+), 0 deletions(-)

diff --git a/surf.suckless.org/patches/surf-tip-bookmarks.diff b/surf.suckless.org/patches/surf-tip-bookmarks.diff @@ -0,0 +1,41 @@ +diff --git a/config.def.h b/config.def.h +index 1c18827..4de93c3 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -37,9 +37,10 @@ static Bool allowgeolocation = TRUE; + + #define SETPROP(p, q) { \ + .v = (char *[]){ "/bin/sh", "-c", \ +- "prop=\"`xprop -id $2 $0 " \ ++ "prop=\"`(xprop -id $2 $0 " \ + "| sed \"s/^$0(STRING) = \\(\\\\\"\\?\\)\\(.*\\)\\1$/\\2/\" " \ +- "| xargs -0 printf %b | dmenu`\" &&" \ ++ "| xargs -0 printf %b &&" \ ++ "cat ~/.surf/bookmarks)| dmenu`\" &&" \ + "xprop -id $2 -f $1 8s -set $1 \"$prop\"", \ + p, q, winid, NULL \ + } \ +@@ -65,6 +66,15 @@ static Bool allowgeolocation = TRUE; + } \ + } + ++#define BM_ADD { \ ++ .v = (char *[]){ "/bin/sh", "-c", \ ++ "(echo `xprop -id $0 _SURF_URI | cut -d '\"' -f 2` && "\ ++ "cat ~/.surf/bookmarks) | awk '!seen[$0]++' > ~/.surf/bookmarks_new && "\ ++ "mv ~/.surf/bookmarks_new ~/.surf/bookmarks", \ ++ winid, NULL \ ++ } \ ++} ++ + /* styles */ + /* + * The iteration will stop at the first match, beginning at the beginning of +@@ -106,6 +116,7 @@ static Key keys[] = { + { MODKEY, GDK_space, scroll_v, { .i = +10000 } }, + { MODKEY, GDK_i, scroll_h, { .i = +1 } }, + { MODKEY, GDK_u, scroll_h, { .i = -1 } }, ++ { MODKEY, GDK_b, spawn, BM_ADD }, + + { 0, GDK_F11, fullscreen, { 0 } }, + { 0, GDK_Escape, stop, { 0 } },