X-Git-Url: https://git.danieliu.xyz/?p=surf.git;a=blobdiff_plain;f=config.def.h;fp=config.def.h;h=f381215aa1f5a080f1d5e22ad182e1d00b62aaad;hp=8a3c92475dc7bed953c04b91fc70bd47ce6d9b6b;hb=c6f48298df2ff2c4a3c7bf2948bbc5fad7628ebc;hpb=56729247de9ae123cc08ed1e45097622340388b6 diff --git a/config.def.h b/config.def.h index 8a3c924..f381215 100644 --- a/config.def.h +++ b/config.def.h @@ -6,6 +6,7 @@ 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"; /* Webkit default features */ /* Highest priority value will be used. @@ -77,6 +78,14 @@ 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",\ @@ -145,6 +154,7 @@ 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") }, { 0, GDK_KEY_Escape, stop, { 0 } },