From 174744ceeb4d8bc4d9ccbde5694c46426617e102 Mon Sep 17 00:00:00 2001 From: BanceDev Date: Wed, 18 Feb 2026 16:34:35 -0500 Subject: added startpage search --- surf.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'surf.c') diff --git a/surf.c b/surf.c index 7a0f624..b980863 100644 --- a/surf.c +++ b/surf.c @@ -560,7 +560,7 @@ void loaduri(Client *c, const Arg *a) { struct stat st; - char *url, *path, *apath; + char *url, *path, *apath, *escaped; const char *uri = a->v; if (g_strcmp0(uri, "") == 0) @@ -580,6 +580,10 @@ loaduri(Client *c, const Arg *a) if (!stat(apath, &st) && (path = realpath(apath, NULL))) { url = g_strdup_printf("file://%s", path); free(path); + } else if (strchr(uri, ' ') || !strchr(uri, '.')) { + escaped = g_uri_escape_string(uri, NULL, TRUE); + url = g_strdup_printf("https://startpage.com/do/search?query=%s", escaped); + g_free(escaped); } else { url = g_strdup_printf("https://%s", uri); } -- cgit v1.2.3-59-g8ed1b