[wiki] [sites] [surf] update spacesearch patch || Alexis

From: <git_AT_suckless.org>
Date: Sat, 08 Apr 2017 17:38:53 +0200

commit f213ebc58123f8d1d95f164a37a644b81230d359
Author: Alexis <alexis.bmj_AT_protonmail.com>
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
_AT_@ -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_AT_gmail.com](mailto:czarkoff_AT_gmail.com)>
+* Alexis Ben Miloud--Josselin (panpo) <[alexis.bmj_AT_protonmail.com](alexis.bmj_AT_protonmail.com)>
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
_AT_@ -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
+_AT_@ -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
+_AT_@ -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);
+ }
Received on Sat Apr 08 2017 - 17:38:53 CEST

This archive was generated by hypermail 2.3.0 : Sat Apr 08 2017 - 17:48:16 CEST