maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   MeeGo / Harmattan (https://talk.maemo.org/forumdisplay.php?f=45)
-   -   [tutorial] Add Search Engines to stock browser (https://talk.maemo.org/showthread.php?t=90469)

xpilz 2013-06-15 19:38

[tutorial] Add Search Engines to stock browser
 
1 Attachment(s)
Tutorial about how to add your own search engines to the stock browser on your N9.

Hi guys. It's not possible to add a new search engine to the list from the UI. So I figured out a way to do it, via terminal. I think it's an unfinished feature, because what you have to do is pretty easy. After you finished this, the search engine will be able to be selected as an item from the list.
(If you want to change the search engine in opera, follow these instructions: http://talk.maemo.org/showthread.php?t=89244.)
In this tutorial we will add the search engine Duck Duck Go. I will also attach a proper search icon, that you can use, at the end.

First you need terminal access. Easiest way to achieve this is:
  • Settings
  • Safety
  • Developer Mode
  • Enable it and follow further instructions

Proceed with opening the terminal (icon on homescreen) and enter the following:
(note: default password is rootme)
Code:

devel-su
cd /usr/share/applications
echo "[Desktop Entry]
Version=1.0
Type=Application
Exec=/usr/bin/browser
MimeType=x-maemo-urischeme/x-web-search;
NotShowIn=X-MeeGo;
X-Maemo-Service=com.nokia.browser
Icon=icon-m-service-ddg
Name=Duck Duck Go
X-Web-Search-Key=q
X-Web-Search-Url=http://www.duckduckgo.com/" > web-search-ddg.desktop

(note: if you want to use the google button, you have to write Icon=icon-m-service-google instead of Icon=icon-m-service-ddg)

Alternatively you can copy another web-search-*.desktop to web-search-ddg.desktop and edit the specific lines.

Then you need to add this file to the UI selection menu. I have tested a bit around and saw the MimeType Parameter (written above). It contains the parameter that holds the information of the search engines (web-search files). The point is you need to edit the mimeinfo.cache file.

Code:

vi /usr/share/applications/mimeinfo.cache
#Search for web-search
#Or goto line 82
:82
#Now add web-search-ddg.desktop; at the end of the line
A
web-search-ddg.desktop;
:x

The next part is only needed if you want to use my search icon.

Get the icon on your phone. Then execute this, while still logged in as root:
(note: assuming you are, where your icon file is)
Code:

mv icon-m-service-ddg.png /usr/share/themes/blanco/meegotouch/icons
Okay nearly done. If you didn't add my icon then you can continue whatever doing before, otherwise a reboot is needed.

That's it. Thanks for reading and I'm happy for every response I get :).

rpcameron 2013-06-17 16:57

Re: [tutorial] Add Search Engines to stock browser
 
That's very similar to what I've done, but as a sidenote: part of DDG's appeal is its lack of tracking. Therefore, it might also be wise to change the search URL to "https" instead of "http" to ensure that each request is encrypted. It might take longer to process because of the SSL handshaking, but that's an inconvenience I (and probably many others) are willing to take.

The other advantage to this is that when searching from the included "Search" app, your DDG search now shows up as an option, which is great for initiating other things using it's !bangs, such as Wikipedia (!w), IMDB (!imdb), Amazon (!a), or even Google (!g).

knobtviker 2013-06-17 21:13

Re: [tutorial] Add Search Engines to stock browser
 
If you want to enable direct https change the line to this in .desktop:
Code:

X-Web-Search-Url=https://duckduckgo.com/
Tested and it works.

Now why wouldn't you package this in a nice little DEB for everyone to use?
For a start. Perhaps later make an app that can generate various search .desktop files and automatically add to mimecache. ;)

xpilz 2013-06-18 22:07

Re: [tutorial] Add Search Engines to stock browser
 
Thanks for suggesting. I'm on it ;).

Greendts 2014-05-05 09:29

Re: [tutorial] Add Search Engines to stock browser
 
has there been any news on a deb? i'm just too stupid to do this myself successfully...

zaidk9 2014-05-10 11:46

Would Like to have it in n9qtweak

Mentalist Traceur 2014-07-16 00:15

Re: [tutorial] Add Search Engines to stock browser
 
Finally looking at basic tweaks like this for my N9 in my scraps of spare time. This was really helpful. (Modern browsers not having built in Open Search support are obscene, and this helps at least bypass the obscenity.)


All times are GMT. The time now is 06:36.

vBulletin® Version 3.8.8