Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
832 B

  1. diff --git a/config.def.h b/config.def.h
  2. index 6d3135e..75dc6a6 100644
  3. --- a/config.def.h
  4. +++ b/config.def.h
  5. @@ -153,6 +153,8 @@ static Key keys[] = {
  6. { MODKEY|GDK_SHIFT_MASK, GDK_KEY_m, toggle, { .i = Style } },
  7. };
  8. +static char *searchengine = "https://duckduckgo.com/?q=";
  9. +
  10. /* button definitions */
  11. /* target can be OnDoc, OnLink, OnImg, OnMedia, OnEdit, OnBar, OnSel, OnAny */
  12. static Button buttons[] = {
  13. diff --git a/surf.c b/surf.c
  14. index 93a1629..c20537e 100644
  15. --- a/surf.c
  16. +++ b/surf.c
  17. @@ -476,6 +476,8 @@ loaduri(Client *c, const Arg *a)
  18. } else if (!stat(uri, &st) && (path = realpath(uri, NULL))) {
  19. url = g_strdup_printf("file://%s", path);
  20. free(path);
  21. + } else if (*uri == ' ') {
  22. + url = g_strdup_printf("%s%s", searchengine, uri + 1);
  23. } else {
  24. url = g_strdup_printf("http://%s", uri);
  25. }