sites

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit f213ebc58123f8d1d95f164a37a644b81230d359
parent 4bebf48de27e8b41f7eeec9afa4647972fe6a77a
Author: Alexis <alexis.bmj@protonmail.com>
Date:   Sat,  8 Apr 2017 17:02:54 +0200

[surf] update spacesearch patch

Diffstat:
Msurf.suckless.org/patches/spacesearch.md | 2++
Asurf.suckless.org/patches/surf-spacesearch-20170408-b814567.diff | 26++++++++++++++++++++++++++
2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/surf.suckless.org/patches/spacesearch.md b/surf.suckless.org/patches/spacesearch.md @@ -15,8 +15,10 @@ Download -------- * [surf-0.6-spacesearch.diff](surf-0.6-spacesearch.diff) (701) (20131110) +* [surf-spacesearch-20170408-b814567.diff](surf-spacesearch-20170408-b814567.diff) (832) (20170408) Author ------ * Dmitrij D. Czarkoff <[czarkoff@gmail.com](mailto:czarkoff@gmail.com)> +* Alexis Ben Miloud--Josselin (panpo) <[alexis.bmj@protonmail.com](alexis.bmj@protonmail.com)> diff --git a/surf.suckless.org/patches/surf-spacesearch-20170408-b814567.diff b/surf.suckless.org/patches/surf-spacesearch-20170408-b814567.diff @@ -0,0 +1,26 @@ +diff --git a/config.def.h b/config.def.h +index 6d3135e..75dc6a6 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -153,6 +153,8 @@ static Key keys[] = { + { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } }, + }; + ++static char *searchengine = "https://duckduckgo.com/?q="; ++ + /* button definitions */ + /* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */ + static Button buttons[] = { +diff --git a/surf.c b/surf.c +index 93a1629..c20537e 100644 +--- a/surf.c ++++ b/surf.c +@@ -476,6 +476,8 @@ loaduri(Client *c, const Arg *a) + } else if (!stat(uri, &st) && (path = realpath(uri, NULL))) { + url = g_strdup_printf("file://%s", path); + free(path); ++ } else if (*uri == ' ') { ++ url = g_strdup_printf("%s%s", searchengine, uri + 1); + } else { + url = g_strdup_printf("http://%s", uri); + }