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

  1. diff --git a/config.def.h b/config.def.h
  2. index 93a3d49..05d81de 100644
  3. --- a/config.def.h
  4. +++ b/config.def.h
  5. @@ -65,6 +65,18 @@ static Bool allowgeolocation = TRUE;
  6. } \
  7. }
  8. +#define ONLOAD(u) { \
  9. + .v = (char *[]){"/bin/sh", "-c", \
  10. + "~/.surf/omnibar addhist \"$0\"", u, NULL \
  11. + } \
  12. +}
  13. +
  14. +#define GOTO { \
  15. + .v = (char *[]){"/bin/sh", "-c", \
  16. + "~/.surf/omnibar goto \"$0\" \"$1\"", winid, "_SURF_GO", NULL \
  17. + } \
  18. +}
  19. +
  20. /* styles */
  21. /*
  22. * The iteration will stop at the first match, beginning at the beginning of
  23. @@ -112,7 +124,7 @@ static Key keys[] = {
  24. { MODKEY, GDK_o, source, { 0 } },
  25. { MODKEY|GDK_SHIFT_MASK,GDK_o, inspector, { 0 } },
  26. - { MODKEY, GDK_g, spawn, SETPROP("_SURF_URI", "_SURF_GO") },
  27. + { MODKEY, GDK_g, spawn, GOTO },
  28. { MODKEY, GDK_f, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") },
  29. { MODKEY, GDK_slash, spawn, SETPROP("_SURF_FIND", "_SURF_FIND") },
  30. diff --git a/surf.c b/surf.c
  31. index f2170a4..c8fdab3 100644
  32. --- a/surf.c
  33. +++ b/surf.c
  34. @@ -789,11 +789,11 @@ loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c)
  35. WebKitWebDataSource *src;
  36. WebKitNetworkRequest *request;
  37. SoupMessage *msg;
  38. - char *uri;
  39. + char *uri = geturi(c);
  40. + Arg arg;
  41. switch (webkit_web_view_get_load_status (c->view)) {
  42. case WEBKIT_LOAD_COMMITTED:
  43. - uri = geturi(c);
  44. if (strstr(uri, "https://") == uri) {
  45. frame = webkit_web_view_get_main_frame(c->view);
  46. src = webkit_web_frame_get_data_source(frame);
  47. @@ -809,6 +809,8 @@ loadstatuschange(WebKitWebView *view, GParamSpec *pspec, Client *c)
  48. setstyle(c, getstyle(uri));
  49. break;
  50. case WEBKIT_LOAD_FINISHED:
  51. + arg = (Arg)ONLOAD(uri);
  52. + spawn(NULL, &arg);
  53. c->progress = 100;
  54. updatetitle(c);
  55. if (diskcache) {