commit f213ebc58123f8d1d95f164a37a644b81230d359
Author: Alexis <[email protected]>
Date:   Sat Apr 8 17:02:54 2017 +0200

    [surf] update spacesearch patch

diff --git a/surf.suckless.org/patches/spacesearch.md 
b/surf.suckless.org/patches/spacesearch.md
index 541bc73..eb5a1d0 100644
--- 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 <[[email protected]](mailto:[email protected])>
+* Alexis Ben Miloud--Josselin (panpo) 
<[[email protected]]([email protected])>
diff --git a/surf.suckless.org/patches/surf-spacesearch-20170408-b814567.diff 
b/surf.suckless.org/patches/surf-spacesearch-20170408-b814567.diff
new file mode 100644
index 0000000..ad5c0fe
--- /dev/null
+++ 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);
+       }


Reply via email to