sites

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

commit 6a67849a0bb130825e7199c3b8c725594dc82164
parent 4fe492a65a1dc215f12e3ddfccb9e845a41c7a51
Author: clamiax <smoppy@gmail.com>
Date:   Tue,  6 Oct 2015 23:22:49 +0200

surf: add omnibar patch

Diffstat:
Asurf.suckless.org/patches/omnibar.md | 20++++++++++++++++++++
Asurf.suckless.org/patches/surf-0.6-omnibar.diff | 45+++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 65 insertions(+), 0 deletions(-)

diff --git a/surf.suckless.org/patches/omnibar.md 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 <[smoppy@gmail.com](mailto:smoppy@gmail.com)> diff --git a/surf.suckless.org/patches/surf-0.6-omnibar.diff 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;