surf-0.6-spacesearch.diff (728B)
1 diff --git a/config.def.h b/config.def.h 2 index a221c86..c3aef5e 100644 3 --- a/config.def.h 4 +++ b/config.def.h 5 @@ -103,3 +103,4 @@ static Key keys[] = { 6 { ClkAny, 0, 9, navigate, { .i = +1 } }, 7 }; 8 9 +static char *searchengine = "https://duckduckgo.com/?q="; 10 diff --git a/surf.c b/surf.c 11 index cebd469..a5c0030 100644 12 --- a/surf.c 13 +++ b/surf.c 14 @@ -626,6 +626,8 @@ loaduri(Client *c, const Arg *arg) { 15 rp = realpath(uri, NULL); 16 u = g_strdup_printf("file://%s", rp); 17 free(rp); 18 + } else if (*uri == ' ') { 19 + u = g_strdup_printf("%s%s", searchengine, uri+1); 20 } else { 21 u = g_strrstr(uri, "://") || g_str_has_prefix(uri, "about:") ? g_strdup(uri) 22 : g_strdup_printf("http://%s", uri);