carlosqmcg
Posts: 1
Joined: Sat Oct 25, 2014 5:45 am

Need Help Changing Epiphany's Default Search Engine.

Sat Oct 25, 2014 6:06 am

I am totally new to the Linux environment, so I need step by step instructions on how to change the default search engine in Epiphany. This Duck Duck Go site is driving me crazy. Can anyone please help?

flynch
Posts: 1
Joined: Sat Nov 01, 2014 4:31 pm

Re: Need Help Changing Epiphany's Default Search Engine.

Mon Nov 17, 2014 1:50 am

This was trickier than I expected.

Here are the steps to change the default search engine in epiphany on raspbian:

1. edit /usr/share/glib-2.0/schemas/org.gnome.epiphany.gschema.xml
This is an xml document. Around line 12 you will find the entries for the keyword-search-url. You will want to change the default tag for this key to point at your preferred search engine rather than duckduckgo. In my case I edited the file so that it looks like the following:

Code: Select all

...
		<key type="s" name="keyword-search-url">
			<!--default>'https://duckduckgo.com/?q=%s&t=raspberrypi'</default-->
			<default>'https://www.google.com/#q=%s'</default>
			<summary>URL Search</summary>
...
Once applied this will cause epiphany to use google as its default search engine.
However editing the file does not apply the change. You will need to rebuild the schema cache to have this change take effect.

2. Before you can rebuild the schema cache you need to install the glib-compile-schemas binary. You can do that with the following command:

Code: Select all

$ sudo apt-get install libglib2.0-bin
3. Now you can compile the schemas:

Code: Select all

$ sudo glib-compile-schemas /usr/share/glib-2.0/schemas
4. Restart epiphany, google should now be your default search engine

Liberal Artist
Posts: 1
Joined: Wed Dec 10, 2014 10:52 pm

Re: Need Help Changing Epiphany's Default Search Engine.

Wed Dec 10, 2014 10:56 pm

This was really helpful, even for a reasonably experienced Linux user (very comfortable working at the command line and so on). I couldn't find any real documentation for how to do this, or much of anything on running Epiphany outside of GNOME. It seems like this would be a common task, so I'm surprised it's so involved and so scantily documented.

User avatar
Mequa
Posts: 172
Joined: Sun Sep 09, 2012 9:54 pm
Location: England
Contact: Website

Re: Need Help Changing Epiphany's Default Search Engine.

Mon Feb 09, 2015 8:47 pm

I tried the above hack on Raspbian on my new Raspberry Pi 2 Model B.

Unfortunately it doesn't seem to work. While Web / Epiphany does indeed now load Google when attempting to search from the browser bar, it does not search for the query entered, but instead prompts for a new search from the Google website.

Is there a fix available for this? Allowing Google as default search engine would vastly improve the browser experience.

robwriter
Posts: 114
Joined: Sat Feb 25, 2012 6:26 pm

Re: Need Help Changing Epiphany's Default Search Engine.

Mon Feb 09, 2015 10:55 pm

+1 to trying to find a solution. I know there are lots of reasons why people would prefer not to use google, but not being able to do so feels weird!

zhihao
Posts: 7
Joined: Tue Feb 10, 2015 2:43 pm

Re: Need Help Changing Epiphany's Default Search Engine.

Tue Feb 10, 2015 2:50 pm

Hi,
New here, how do you ¨edit /usr/share/glib-2.0/schemas/org.gnome.epiphany.gschema.xml¨?
It seems I cant change the permission of the XML file.
Thanks.

User avatar
Mequa
Posts: 172
Joined: Sun Sep 09, 2012 9:54 pm
Location: England
Contact: Website

How to change Web / Epiphany's default search engine

Tue Feb 10, 2015 3:38 pm

zhihao wrote:Hi,
New here, how do you ¨edit /usr/share/glib-2.0/schemas/org.gnome.epiphany.gschema.xml¨?
It seems I cant change the permission of the XML file.
Thanks.
Update: This fix now works on the new version of Web / Epiphany.

You can try it by opening a Terminal and typing:

Code: Select all

sudo leafpad /usr/share/glib-2.0/schemas/org.gnome.epiphany.gschema.xml
Leafpad will print some garbage in the Terminal window, you can ignore this.

Or if you prefer to use a purely text-based editor in the Terminal, use this instead of the above:

Code: Select all

sudo nano /usr/share/glib-2.0/schemas/org.gnome.epiphany.gschema.xml
Then use Leafpad or nano to change the following section (this is the whole section to change):

Code: Select all

         <key type="s" name="keyword-search-url">
                  <!--default>'https://duckduckgo.com/?q=%s&t=raspberrypi'</default-->
                  <default>'https://www.google.com/search?q=%s'</default>
                  <summary>URL Search</summary>
                  <description>Search string for keywords entered in the URL bar.</description>
         </key>
Or for UK users, Google.co.uk is recommended instead as it saves having to access a server across the Atlantic.
Try this instead if you are in the UK:

Code: Select all

         <key type="s" name="keyword-search-url">
                  <!--default>'https://duckduckgo.com/?q=%s&t=raspberrypi'</default-->
                  <default>'https://www.google.co.uk/search?q=%s'</default>
                  <summary>URL Search</summary>
                  <description>Search string for keywords entered in the URL bar.</description>
         </key>
The text editor should then successfully overwrite the system file with root privileges. Save the file and exit the text editor.

You then need to install the following dependency from the Terminal, if it's not already installed:

Code: Select all

sudo apt-get install libglib2.0-bin
And then recompile the browser schemas from the Terminal, as follows:

Code: Select all

sudo glib-compile-schemas /usr/share/glib-2.0/schemas
Close the Terminal and restart Web / Epiphany.

This fix works now, and this also shows how to edit the system files with root privileges.
Last edited by Mequa on Fri Feb 13, 2015 11:35 pm, edited 4 times in total.

User avatar
Mequa
Posts: 172
Joined: Sun Sep 09, 2012 9:54 pm
Location: England
Contact: Website

Re: Need Help Changing Epiphany's Default Search Engine.

Wed Feb 11, 2015 7:14 am

OK, I found a fix. I've also updated the above to reflect this.

Update: The correct code to enter in the schemas file is:

Code: Select all

         <key type="s" name="keyword-search-url">
                  <!--default>'https://duckduckgo.com/?q=%s&t=raspberrypi'</default-->
                  <default>'https://www.google.com/search?q=%s'</default>
                  <summary>URL Search</summary>
                  <description>Search string for keywords entered in the URL bar.</description>
         </key>
Update: This fix now works correctly.

If you are in the UK, you can replace google.com with google.co.uk in the above code (or use your local Google search if outside the US and UK), which should make it slightly faster, too.
Last edited by Mequa on Fri Feb 13, 2015 11:24 pm, edited 1 time in total.

zhihao
Posts: 7
Joined: Tue Feb 10, 2015 2:43 pm

Re: Need Help Changing Epiphany's Default Search Engine.

Wed Feb 11, 2015 2:53 pm

Thanks. At least changed from duck duck go which gives bad results.

casperc
Posts: 1
Joined: Thu Feb 12, 2015 7:33 am

Re: Need Help Changing Epiphany's Default Search Engine.

Thu Feb 12, 2015 7:40 am

Mequa wrote: With this fix, Web / Epiphany will attempt to query the search term from Google.

It is somewhat slow though, as it will enter it into the Google homepage search, then bring up search suggestions, requiring pressing enter again (in my testing). At least it does search from Google now, though.
To fix this, use this instead:

Code: Select all

         <key type="s" name="keyword-search-url">
                  <!--default>'https://duckduckgo.com/?q=%s&t=raspberrypi'</default-->
                  <default>'https://www.google.com/search?q=%s'</default>
                  <summary>URL Search</summary>
                  <description>Search string for keywords entered in the URL bar.</description>
         </key>

User avatar
Mequa
Posts: 172
Joined: Sun Sep 09, 2012 9:54 pm
Location: England
Contact: Website

Re: Need Help Changing Epiphany's Default Search Engine.

Fri Feb 13, 2015 11:22 pm

casperc wrote:
Mequa wrote: With this fix, Web / Epiphany will attempt to query the search term from Google.

It is somewhat slow though, as it will enter it into the Google homepage search, then bring up search suggestions, requiring pressing enter again (in my testing). At least it does search from Google now, though.
To fix this, use this instead:

Code: Select all

         <key type="s" name="keyword-search-url">
                  <!--default>'https://duckduckgo.com/?q=%s&t=raspberrypi'</default-->
                  <default>'https://www.google.com/search?q=%s'</default>
                  <summary>URL Search</summary>
                  <description>Search string for keywords entered in the URL bar.</description>
         </key>
That fix worked perfectly. I changed the above from google.com to google.co.uk which also works fine.

It might be worth writing a script which does this automatically. It appears this difficulty arises running Web / Epiphany under LXDE rather than GNOME which has configuration tools for it. For now this manual method works fine using the above code.

Edit: I updated my guide to this in the above post here, so beginners can have a simple step-by-step guide to this which just works.

Scott Chiste
Posts: 11
Joined: Tue Jul 14, 2015 2:05 pm

Re: Need Help Changing Epiphany's Default Search Engine.

Tue Jul 14, 2015 7:47 pm

It is the step where i need to recompile that i am stuck.

I typed in exactlymwhat was asked, and ut says "Error on line 13 character 67: ' ' is not a valid character following a '<' character; it may not begin an element name . This entire file has been ignored."

What do i do from here :?:

DGxInfinitY
Posts: 3
Joined: Tue Dec 22, 2015 7:35 pm
Location: Utah
Contact: Website

Re: Need Help Changing Epiphany's Default Search Engine.

Tue Feb 02, 2016 3:27 am

I am also getting errors when I try to compile the schema file.

Gomoto
Posts: 125
Joined: Tue Feb 12, 2013 1:21 am

Re: Need Help Changing Epiphany's Default Search Engine.

Sat Mar 19, 2016 1:38 pm

You can use dconf-editor to change Epiphany's default search engine.

First install dconf-editor in the terminal:
sudo apt-get install dconf-editor

Then you can change the default search engine with dconf-editor:
org/gnome/epiphany keyword-search-url

User avatar
dev_bot
Posts: 8
Joined: Mon Jun 06, 2016 4:16 pm

Re: Need Help Changing Epiphany's Default Search Engine.

Mon Jun 06, 2016 4:20 pm

Thanks a lot for everyone's help and contribution on this! It really helped! :D
Also, it's worth using the command line method to open the file like this:

Code: Select all

sudo leafpad /usr/share/glib-2.0/schemas/org.gnome.epiphany.gschema.xml
because if you try to edit it WITHOUT superuser, it will not work.
"Ooh, pie!"

There are 10 types of people: those who understand binary and those who don't.

Return to “Beginners”