sites

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

commit 384cd899664f9f1895553689b2c3bc60fbb1e21b
parent ba3ad701171441c509d4255ba032457dfbcf5c6c
Author: Claudio Alessi <smoppy@gmail.com>
Date:   Sun, 10 Jan 2016 16:01:25 +0100

[surf][omnibar] update to 0.7

Diffstat:
Msurf.suckless.org/patches/omnibar.md | 4++--
Dsurf.suckless.org/patches/surf-0.6-omnibar.diff | 59-----------------------------------------------------------
Asurf.suckless.org/patches/surf-0.7-omnibar.diff | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 61 insertions(+), 61 deletions(-)

diff --git a/surf.suckless.org/patches/omnibar.md b/surf.suckless.org/patches/omnibar.md @@ -28,8 +28,8 @@ Now you can use the following key (don't forget to remove the old one): Download -------- -* [surf-0.6-omnibar.diff](surf-0.6-omnibar.diff) (20151006) -* [omnibar-3477b69](https://github.com/clamiax/.surf/blob/3477b69c5b00ad0129b163b22c84b8ed560abbb3/omnibar) +* [surf-0.7-omnibar.diff](surf-0.7-omnibar.diff) +* [omnibar](https://raw.githubusercontent.com/clamiax/.surf/374e101748093215e8ecbf00a24a764932b60ed7/omnibar) Author ------ diff --git a/surf.suckless.org/patches/surf-0.6-omnibar.diff b/surf.suckless.org/patches/surf-0.6-omnibar.diff @@ -1,59 +0,0 @@ -diff -wu surf-0.6/config.def.h surf-0.6-edit/config.def.h ---- surf-0.6/config.def.h 2013-02-10 19:40:14.000000000 +0100 -+++ surf-0.6-edit/config.def.h 2015-11-07 13:12:23.854017366 +0100 -@@ -43,6 +43,18 @@ - } \ - } - -+#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 \ -+ } \ -+} -+ - #define MODKEY GDK_CONTROL_MASK - - /* hotkeys */ -@@ -80,7 +92,7 @@ - { 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") }, - -Solo in surf-0.6-edit/: config.h -Solo in surf-0.6-edit/: surf-0.6-omnibar.diff -diff -wu surf-0.6/surf.c surf-0.6-edit/surf.c ---- surf-0.6/surf.c 2013-02-10 19:40:14.000000000 +0100 -+++ surf-0.6-edit/surf.c 2015-11-07 13:13:24.253997068 +0100 -@@ -588,11 +588,11 @@ - WebKitWebDataSource *src; - WebKitNetworkRequest *request; - SoupMessage *msg; -- char *uri; -+ char *uri = geturi(c); -+ Arg arg; - - switch(webkit_web_view_get_load_status (c->view)) { - case WEBKIT_LOAD_COMMITTED: -- uri = geturi(c); - if(strstr(uri, "https://") == uri) { - frame = webkit_web_view_get_main_frame(c->view); - src = webkit_web_frame_get_data_source(frame); -@@ -604,6 +604,8 @@ - setatom(c, AtomUri, uri); - break; - case WEBKIT_LOAD_FINISHED: -+ arg = (Arg)ONLOAD(uri); -+ spawn(NULL, &arg); - c->progress = 100; - update(c); - break; diff --git a/surf.suckless.org/patches/surf-0.7-omnibar.diff b/surf.suckless.org/patches/surf-0.7-omnibar.diff @@ -0,0 +1,59 @@ +diff --git a/config.def.h b/config.def.h +index 93a3d49..05d81de 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -65,6 +65,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 +@@ -112,7 +124,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 f2170a4..c8fdab3 100644 +--- a/surf.c ++++ b/surf.c +@@ -789,11 +789,11 @@ loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c) + WebKitWebDataSource *src; + WebKitNetworkRequest *request; + SoupMessage *msg; +- char *uri; ++ char *uri = geturi(c); ++ Arg arg; + + switch (webkit_web_view_get_load_status (c->view)) { + case WEBKIT_LOAD_COMMITTED: +- uri = geturi(c); + if (strstr(uri, "https://") == uri) { + frame = webkit_web_view_get_main_frame(c->view); + src = webkit_web_frame_get_data_source(frame); +@@ -809,6 +809,8 @@ loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c) + setstyle(c, getstyle(uri)); + break; + case WEBKIT_LOAD_FINISHED: ++ arg = (Arg)ONLOAD(uri); ++ spawn(NULL, &arg); + c->progress = 100; + updatetitle(c); + if (diskcache) {