applied play external
[surf.git] / config.def.h
index f381215..13fc1bc 100644 (file)
@@ -6,7 +6,13 @@ static char *styledir       = "~/.surf/styles/";
 static char *certdir        = "~/.surf/certificates/";
 static char *cachedir       = "~/.surf/cache/";
 static char *cookiefile     = "~/.surf/cookies.txt";
-static char *searchurl      = "duckduckgo.com/?q=%s";
+
+static SearchEngine searchengines[] = {
+    { "g",    "https://www.google.com/search?q=%s"             },
+    { "ji",   "https://jisho.org/search/%s"                    },
+    { "aw",   "https://wiki.archlinux.org/index.php?search=%s" },
+    { "s",    "https://searx.danieliu.xyz/?q=%s"               }
+};
 
 /* Webkit default features */
 /* Highest priority value will be used.
@@ -78,14 +84,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",\
@@ -154,9 +152,10 @@ 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_s,      spawn,      SEARCH() }, 
        { MODKEY,                GDK_KEY_m,      spawn,      BM_ADD("_SURF_URI") },
 
+       { MODKEY,                GDK_KEY_w,      playexternal, { 0 } },
+
        { 0,                     GDK_KEY_Escape, stop,       { 0 } },
        { MODKEY,                GDK_KEY_c,      stop,       { 0 } },
 
@@ -217,4 +216,4 @@ static Button buttons[] = {
        { OnMedia,      MODKEY,         1,      clickexternplayer, { 0 },       1 },
 };
 
-#define HOMEPAGE "https://duckduckgo.com/"
+#define HOMEPAGE "https://searx.danieliu.xyz/"