commit 6a67849a0bb130825e7199c3b8c725594dc82164
Author: clamiax <[email protected]>
Date:   Tue Oct 6 23:22:49 2015 +0200

    surf: add omnibar patch

diff --git a/surf.suckless.org/patches/omnibar.md 
b/surf.suckless.org/patches/omnibar.md
new file mode 100644
index 0000000..e30dea0
--- /dev/null
+++ b/surf.suckless.org/patches/omnibar.md
@@ -0,0 +1,20 @@
+Omnibar
+=======
+Run a command each time an URI is loaded. Since the URI may be passed as
+argument, this patch along with a proper script allows to manage browsing
+history in many convenient ways. If the default omnibar script (see below)
+don't fit your needs it's easy to refine the ONLOAD and GOTO constants in the
+config.h file.
+
+URIs visited by clicking on links will be stored as well.
+
+Note: the patch also changes the config.def.h file.
+
+Download
+--------
+* [surf-0.6-omnibar.diff](surf-0.6-omnibar.diff) (1.4k) (20151006)
+* 
[omnibar-7b4a6055f2a7a8326e93f4d6eb6a3a47bb17fec0](https://github.com/clamiax/.surf/blob/7b4a6055f2a7a8326e93f4d6eb6a3a47bb17fec0/omnibar)
+
+Author
+------
+* Claudio Alessi <[[email protected]](mailto:[email protected])>
diff --git a/surf.suckless.org/patches/surf-0.6-omnibar.diff 
b/surf.suckless.org/patches/surf-0.6-omnibar.diff
new file mode 100644
index 0000000..7972115
--- /dev/null
+++ b/surf.suckless.org/patches/surf-0.6-omnibar.diff
@@ -0,0 +1,45 @@
+diff --git a/config.def.h b/config.def.h
+index 1eb9566..fac7fa7 100644
+--- a/config.def.h
++++ b/config.def.h
+@@ -63,6 +63,18 @@ static Bool allowgeolocation      = TRUE;
+       } \
+ }
+ 
++#define ONLOAD(u) { \
++      .v = (char *[]){"/bin/sh", "-c", \
++              "~/.surf/omnibar addhist \"$0\"", u, NULL \
++      }  \
++}
++
++#define GOTO { \
++      .v = (char *[]){"/bin/sh", "-c", \
++              "~/.surf/omnibar goto $0 $1", winid, "_SURF_GO", NULL \
++      } \
++}
++
+ /* styles */
+ /*
+  * The iteration will stop at the first match, beginning at the beginning of
+@@ -110,7 +122,7 @@ static Key keys[] = {
+     { MODKEY,               GDK_o,      source,     { 0 } },
+     { MODKEY|GDK_SHIFT_MASK,GDK_o,      inspector,  { 0 } },
+ 
+-    { MODKEY,               GDK_g,      spawn,      SETPROP("_SURF_URI", 
"_SURF_GO") },
++    { MODKEY,               GDK_g,      spawn,      GOTO },
+     { MODKEY,               GDK_f,      spawn,      SETPROP("_SURF_FIND", 
"_SURF_FIND") },
+     { MODKEY,               GDK_slash,  spawn,      SETPROP("_SURF_FIND", 
"_SURF_FIND") },
+ 
+diff --git a/surf.c b/surf.c
+index 02656ec..1d84358 100644
+--- a/surf.c
++++ b/surf.c
+@@ -731,6 +731,8 @@ loadstatuschange(WebKitWebView *view, GParamSpec *pspec, 
Client *c) {
+                       g_object_set(G_OBJECT(set), "user-stylesheet-uri",
+                                       getstyle(uri), NULL);
+               }
++              Arg a = (Arg)ONLOAD((char *)uri);
++              spawn(NULL, &a);
+               break;
+       case WEBKIT_LOAD_FINISHED:
+               c->progress = 100;


Reply via email to