Tuesday, August 17, 2010

Change default search engine country Firefox Ubuntu

Ha! Took about an hour or so.

I'm running Firefox 3.6.8 on Ubuntu 10.04 and for whatever reason, I didn't end up with the default settings that I wanted (probably my fault at setup). At any rate, what I wanted to do was change the default search engine from google.com to google.com.au (sounds easy, right?).

Now, if you want to change the search engine, it actually is quite easy. In the search bar (top right box) there is a drop-down next to the current search engine favicon which will let you change between the different search engine. Mine lists Google, Yahoo, eBay, Wikipedia and a few others. What I want to do is change google.com to google.com.au which is a little harder.

I'll save you the boring details and jump straight to the solution.
  1. Open the terminal, type gksudo nautilus (don't use sudo, you want gksudo which will give you a graphical interface)
  2. Find the searchplugins folder. Mine was in /usr/lib/firefox-3.6.8/searchplugins (if you can't find it, run a search for google.xml in your system, that's the file you want). It may also show up in other places (like /usr/lib/.mozilla/ depending on your system). Also note that the 3.6.8 bit will depend on your version.
  3. As an extra step, in my system it had two more folders, en-GB and en-US and a google.xml file was inside both - you may have both, neither or something else.
  4. What I did was copy the google.xml file and rename it google-au.xml (this is so that if I stuff anything up, the original file is still there).
  5. Inside that file, find every instance of .com and change it to .com.au (or to what you need, like .co.uk). There are about three or four places to change this. I also changed the short name to Google AU so that it would make it easy to see which I was using in the drop-down list. Ignore everything else.
  6. Save the file, close Nautilus and re-start Firefox.
With Firefox re-started, it was easy enough to use the "Manage Search Engines" option at the bottom of the drop-down and move the AU version to the top (and the US to the second spot so I can quickly change to US if I need different search options).

I initially only changed the xml file in the en-US folder (I assumed that was the one being used) but it didn't work. I re-did the above except that I just copied the google-au.xml file over into the en-GB folder and then it worked. This was also the payoff for making a new file rather than just editing the original file.

My biggest problem in getting this changed was that most places that said how to make the change either had the simple solution of altering the order of the drop-down or had the difficult solution of editing the google.xml file but omitted that you had to be in Nautilus with root permission in order to do it (if you just use "Places" to navigate to the file you can only read it, not edit it).

After that the rest was easy. Now, just need to buff out the fore-head shaped dents on my desk...

No comments: