sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

surf-0.6-spacesearch.diff (690B)


      1 diff --git a/config.def.h b/config.def.h
      2 index a221c86..c3aef5e 100644
      3 --- a/config.def.h
      4 +++ b/config.def.h
      5 @@ -103,3 +103,4 @@ static Key keys[] = {
      6      { MODKEY|GDK_SHIFT_MASK,GDK_g,      togglegeolocation, { 0 } },
      7  };
      8  
      9 +static char *searchengine   = "https://duckduckgo.com/?q=";
     10 diff --git a/surf.c b/surf.c
     11 index cebd469..a5c0030 100644
     12 --- a/surf.c
     13 +++ b/surf.c
     14 @@ -626,6 +626,8 @@ loaduri(Client *c, const Arg *arg) {
     15  		rp = realpath(uri, NULL);
     16  		u = g_strdup_printf("file://%s", rp);
     17  		free(rp);
     18 +	} else if (*uri == ' ') {
     19 +		u = g_strdup_printf("%s%s", searchengine, uri+1);
     20  	} else {
     21  		u = g_strrstr(uri, "://") ? g_strdup(uri)
     22  			: g_strdup_printf("http://%s", uri);