Revert "applied websearch"
authorDaniel Liu <mr.picklepinosaur@gmail.com>
Tue, 4 Aug 2020 02:50:13 +0000 (22:50 -0400)
committerDaniel Liu <mr.picklepinosaur@gmail.com>
Tue, 4 Aug 2020 02:50:13 +0000 (22:50 -0400)
This reverts commit c6f48298df2ff2c4a3c7bf2948bbc5fad7628ebc.

config.def.h
surf.c

index f381215..8a3c924 100644 (file)
@@ -6,7 +6,6 @@ static char *styledir       = "~/.surf/styles/";
 static char *certdir        = "~/.surf/certificates/";
 static char *cachedir       = "~/.surf/cache/";
 static char *cookiefile     = "~/.surf/cookies.txt";
 static char *certdir        = "~/.surf/certificates/";
 static char *cachedir       = "~/.surf/cache/";
 static char *cookiefile     = "~/.surf/cookies.txt";
-static char *searchurl      = "duckduckgo.com/?q=%s";
 
 /* Webkit default features */
 /* Highest priority value will be used.
 
 /* Webkit default features */
 /* Highest priority value will be used.
@@ -78,14 +77,6 @@ static WebKitFindOptions findopts = WEBKIT_FIND_OPTIONS_CASE_INSENSITIVE |
         } \
 }
 
         } \
 }
 
-#define SEARCH() { \
-        .v = (const char *[]){ "/bin/sh", "-c", \
-             "xprop -id $1 -f $2 8s -set $2 \"" \
-             "$(dmenu -p Search: -w $1 < /dev/null)\"", \
-             "surf-search", winid, "_SURF_SEARCH", NULL \
-        } \
-}
-
 /* DOWNLOAD(URI, referer) */
 #define DOWNLOAD(u, r) { \
         .v = (const char *[]){ "st", "-e", "/bin/sh", "-c",\
 /* DOWNLOAD(URI, referer) */
 #define DOWNLOAD(u, r) { \
         .v = (const char *[]){ "st", "-e", "/bin/sh", "-c",\
@@ -154,7 +145,6 @@ static Key keys[] = {
        { MODKEY,                GDK_KEY_g,      spawn,      SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) },
        { MODKEY,                GDK_KEY_f,      spawn,      SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
        { MODKEY,                GDK_KEY_slash,  spawn,      SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
        { MODKEY,                GDK_KEY_g,      spawn,      SETPROP("_SURF_URI", "_SURF_GO", PROMPT_GO) },
        { MODKEY,                GDK_KEY_f,      spawn,      SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
        { MODKEY,                GDK_KEY_slash,  spawn,      SETPROP("_SURF_FIND", "_SURF_FIND", PROMPT_FIND) },
-    { MODKEY,                GDK_KEY_s,      spawn,      SEARCH() }, 
        { MODKEY,                GDK_KEY_m,      spawn,      BM_ADD("_SURF_URI") },
 
        { 0,                     GDK_KEY_Escape, stop,       { 0 } },
        { MODKEY,                GDK_KEY_m,      spawn,      BM_ADD("_SURF_URI") },
 
        { 0,                     GDK_KEY_Escape, stop,       { 0 } },
diff --git a/surf.c b/surf.c
index 9d2dacb..aad863e 100644 (file)
--- a/surf.c
+++ b/surf.c
@@ -35,7 +35,7 @@
 #define LENGTH(x)               (sizeof(x) / sizeof(x[0]))
 #define CLEANMASK(mask)         (mask & (MODKEY|GDK_SHIFT_MASK))
 
 #define LENGTH(x)               (sizeof(x) / sizeof(x[0]))
 #define CLEANMASK(mask)         (mask & (MODKEY|GDK_SHIFT_MASK))
 
-enum { AtomFind, AtomSearch, AtomGo, AtomUri, AtomLast };
+enum { AtomFind, AtomGo, AtomUri, AtomLast };
 
 enum {
        OnDoc   = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT,
 
 enum {
        OnDoc   = WEBKIT_HIT_TEST_RESULT_CONTEXT_DOCUMENT,
@@ -231,7 +231,6 @@ static void togglefullscreen(Client *c, const Arg *a);
 static void togglecookiepolicy(Client *c, const Arg *a);
 static void toggleinspector(Client *c, const Arg *a);
 static void find(Client *c, const Arg *a);
 static void togglecookiepolicy(Client *c, const Arg *a);
 static void toggleinspector(Client *c, const Arg *a);
 static void find(Client *c, const Arg *a);
-static void search(Client *c, const Arg *a);
 
 /* Buttons */
 static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h);
 
 /* Buttons */
 static void clicknavigate(Client *c, const Arg *a, WebKitHitTestResult *h);
@@ -327,7 +326,6 @@ setup(void)
 
        /* atoms */
        atoms[AtomFind] = XInternAtom(dpy, "_SURF_FIND", False);
 
        /* atoms */
        atoms[AtomFind] = XInternAtom(dpy, "_SURF_FIND", False);
-       atoms[AtomSearch] = XInternAtom(dpy, "_SURF_SEARCH", False);
        atoms[AtomGo] = XInternAtom(dpy, "_SURF_GO", False);
        atoms[AtomUri] = XInternAtom(dpy, "_SURF_URI", False);
 
        atoms[AtomGo] = XInternAtom(dpy, "_SURF_GO", False);
        atoms[AtomUri] = XInternAtom(dpy, "_SURF_URI", False);
 
@@ -579,19 +577,6 @@ loaduri(Client *c, const Arg *a)
        g_free(url);
 }
 
        g_free(url);
 }
 
-void
-search(Client *c, const Arg *a)
-{
-       Arg arg;
-       char *url;
-
-       url = g_strdup_printf(searchurl, a->v);
-       arg.v = url;
-       loaduri(c, &arg);
-
-       g_free(url);
-}
-
 const char *
 geturi(Client *c)
 {
 const char *
 geturi(Client *c)
 {
@@ -1326,9 +1311,6 @@ processx(GdkXEvent *e, GdkEvent *event, gpointer d)
                                find(c, NULL);
 
                                return GDK_FILTER_REMOVE;
                                find(c, NULL);
 
                                return GDK_FILTER_REMOVE;
-                       } else if (ev->atom == atoms[AtomSearch]) {
-                               a.v = getatom(c, AtomSearch);
-                               search(c, &a);
                        } else if (ev->atom == atoms[AtomGo]) {
                                a.v = getatom(c, AtomGo);
                                loaduri(c, &a);
                        } else if (ev->atom == atoms[AtomGo]) {
                                a.v = getatom(c, AtomGo);
                                loaduri(c, &a);