Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

59 lines
1.8 KiB

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) {