commit 43e2a56027e55c571e0fa43467ba779b573f1570
Author: lieven moors <[email protected]>
Date:   Sat Nov 14 19:05:54 2015 +0100

    Adapted the bookmarks patch to apply against current tip.

diff --git a/surf.suckless.org/patches/surf-tip-bookmarks.diff 
b/surf.suckless.org/patches/surf-tip-bookmarks.diff
new file mode 100644
index 0000000..6c4fbc1
--- /dev/null
+++ 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 } },


Reply via email to