[wiki] [sites] add surf-0.6-spacesearch.diff and description || Dmitrij D. Czarkoff

From: <git_AT_suckless.org>
Date: Sun, 10 Nov 2013 21:55:42 +0100

commit afe2d3f241be920b1c5d8ab7ea37245d115a34c9
Author: Dmitrij D. Czarkoff <czarkoff_AT_gmail.com>
Date: Sun Nov 10 21:54:33 2013 +0100

    add surf-0.6-spacesearch.diff and description

diff --git a/surf.suckless.org/patches/spacesearch.md b/surf.suckless.org/patches/spacesearch.md
new file mode 100644
index 0000000..541bc73
--- /dev/null
+++ b/surf.suckless.org/patches/spacesearch.md
_AT_@ -0,0 +1,22 @@
+Space search
+============
+
+Description
+-----------
+
+This patch makes surf treat `_SURF_URI` string with leading whitespace as
+search query. The search engine to send queries to is defined in `config.h`:
+
+ static char *searchengine = "https://duckduckgo.com/?q=";
+
+(The patch adds this string to `config.def.h`.)
+
+Download
+--------
+
+* [surf-0.6-spacesearch.diff](surf-0.6-spacesearch.diff) (701) (20131110)
+
+Author
+------
+
+* Dmitrij D. Czarkoff <[czarkoff_AT_gmail.com](mailto:czarkoff_AT_gmail.com)>
diff --git a/surf.suckless.org/patches/surf-0.6-spacesearch.diff b/surf.suckless.org/patches/surf-0.6-spacesearch.diff
new file mode 100644
index 0000000..cce7986
--- /dev/null
+++ b/surf.suckless.org/patches/surf-0.6-spacesearch.diff
_AT_@ -0,0 +1,22 @@
+diff --git a/config.def.h b/config.def.h
+index a221c86..c3aef5e 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -93,3 +93,4 @@ static Key keys[] = {
+ { MODKEY|GDK_SHIFT_MASK,GDK_v, toggle, { .v = "enable-plugins" } },
+ };
+
++static char *searchengine = "https://duckduckgo.com/?q=";
+diff --git a/surf.c b/surf.c
+index cebd469..a5c0030 100644
+--- a/surf.c
++++ b/surf.c
+_AT_@ -626,6 +626,8 @@ loaduri(Client *c, const Arg *arg) {
+ rp = realpath(uri, NULL);
+ u = g_strdup_printf("file://%s", rp);
+ free(rp);
++ } else if (*uri == ' ') {
++ u = g_strdup_printf("%s%s", searchengine, uri+1);
+ } else {
+ u = g_strrstr(uri, "://") ? g_strdup(uri)
+ : g_strdup_printf("http://%s", uri);
Received on Sun Nov 10 2013 - 21:55:42 CET

This archive was generated by hypermail 2.3.0 : Thu Jun 18 2015 - 17:37:56 CEST