summaryrefslogtreecommitdiffstats
path: root/surf.c
diff options
context:
space:
mode:
authorGravatar BanceDev 2026-02-18 16:34:35 -0500
committerGravatar BanceDev 2026-02-18 16:34:35 -0500
commit174744ceeb4d8bc4d9ccbde5694c46426617e102 (patch)
treeb9817010bff489be11ff49d163eb3af1d3a194ea /surf.c
parentFix (2) some typo for kiosk mode in the man-page (diff)
added startpage search
Diffstat (limited to 'surf.c')
-rw-r--r--surf.c6
1 files changed, 5 insertions, 1 deletions
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);
}