[dev] [surf] Script for searchengines.

From: Thuban <arrakispice_AT_gmail.com>
Date: Mon, 29 Mar 2010 08:24:29 +0200

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%c3%a9cial%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") },
Received on Mon Mar 29 2010 - 06:24:29 UTC

This archive was generated by hypermail 2.2.0 : Mon Mar 29 2010 - 06:36:13 UTC