Since searchengines patch can't be applied to hg surf code, without
editing manually, I wrote this script to do the same. If anyone is
interested...
It might need some improvement I think, and you might change
searchengines to fit your needs : 
Here the script :
#-------------------------------------------------------------
#!/bin/sh
#search engines for surf

#dmenu colors
SB="#AFAFAF"
SF="#000000"
NB="#0C0C0C"
NF="#D4D4D4"

ENTREE=$(echo "" |dmenu -i -nb $NB -nf $NF -sb $SB -sf $SF)
ENGINE=$(echo $ENTREE |cut -d ' ' -f 1 )
RECHERCHE=$(echo $ENTREE |cut -d ' ' -f2- |sed 's/ /+/g')
        case $ENGINE in
                ix ) echo -n
"https://eu.ixquick.com/do/metasearch.pl?query=$RECHERCHE&language=francais"; ;;
g )  echo "http://www.google.fr/search?q=$RECHERCHE"; ;; wik )  echo -n
"http://fr.wikipedia.org/w/index.php?title=Spécial%3ARecherche&search=$RECHERCHE'&'go=Lire"
 ;;
dic )  echo -n
"http://www.le-dictionnaire.com/definition.php?mot=$RECHERCHE"; ;;
tor )  echo -n "http://btjunkie.org/search?q=$RECHERCHE"; ;; e )  echo
-n "http://www.ethicle.com/fr/search.php?q=$RECHERCHE"; ;; esac

exit
#-------------------------------------------------------------

And add it to config.h : 

#define SEARCHENGINE(p)           { .v = (char *[]){ "/bin/sh", "-c", \
    "xprop -id $1 -set $0 `path/to/script/searchengines.sh` || exit
0", p, winid, NULL } }

...
...

    { MODKEY,               GDK_f,      spawn,
SEARCHENGINE("_SURF_URI") },

Reply via email to