diff options
| author | 2026-02-18 16:34:35 -0500 | |
|---|---|---|
| committer | 2026-02-18 16:34:35 -0500 | |
| commit | 174744ceeb4d8bc4d9ccbde5694c46426617e102 (patch) | |
| tree | b9817010bff489be11ff49d163eb3af1d3a194ea /surf.c | |
| parent | Fix (2) some typo for kiosk mode in the man-page (diff) | |
added startpage search
Diffstat (limited to '')
| -rw-r--r-- | surf.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); } |
