Fixing the FirefoxOS default search provider

WTF? FirefoxOS uses Bing as default search provider?

Yuck, I must fix that. Finally after almost a week I have had some time for me and that’s the first thing I must fix. Thanks to the very helpful comment from Mathieu in this blog post, I wrote a very small shell script that replaces the search provider to your favorite one, defaulting to Google.

It uses sudo for the privileged commands but doesn’t need to completely run as root. Its your choice, run ./fix-ffos-search-provider.sh or sudo ./fix-ffos-search-provider.sh taking as optional arguments (in this order), the Title, the URL and it’s Favicon url. Miss one and the Google default will be used 🙂 eg:

./fix-ffos-search-provider.sh \
  "Duck Duck Go" https://duckduckgo.com/ https://duckduckgo.com/favicon.ico

First, it sets the options, then starts adb-server and fetches the browser application (note that you need the android-tools package in Fedora or the Android SDK):

#!/bin/sh

TITLE=${1:-Google}
URL=${2:-www.google.com/m}
ICO=${3:-https://www.google.com/favicon.ico}

sudo adb start-server

sudo adb pull \
  /system/b2g/webapps/browser.gaiamobile.org/application.zip
sudo chown $USER:$GROUP application.zip

mkdir application
cd application/
unzip ../application.zip

Then, it does the magic with the help of Perl:

perl -pi -e " \
    s|(DEFAULT_SEARCH_PROVIDER_URL: ?)'.*?'|\$1'$URL'|; \
    s|(DEFAULT_SEARCH_PROVIDER_TITLE: ?)'.*?'|\$1'$TITLE'|; \
    s|(DEFAULT_SEARCH_PROVIDER_ICON: ?)'.*?'|\$1'$URL'|; \
    " js/browser.js gaia_build_defer_index.js

Finally, it rebuilds the browser application and pushes it back to the phone and reboots it (it shouldn’t need a reboot, maybe there’s a way to avoid this?):

zip -fr ../application.zip .
cd ..

sudo adb remount
sudo adb push application.zip \
   /system/b2g/webapps/browser.gaiamobile.org/application.zip
sudo adb reboot

So, here it is, finally fixed 🙂 Well, temporarily (it will be better fixed following the results of https://github.com/mozilla-b2g/gaia/pull/9454 and https://github.com/gasolin/gaia/commit/47072a825d9e7c2859f4f8de4fb200cc7450e10b or something similar) at least.

Screenshot of FirefoxOS browser googling for 'test'
Googling for ‘test’


CC0
To the extent possible under law, Rui Miguel Silva Seabra has waived all copyright and related or neighboring rights to Fix FirefoxOS Default Search Provider. This work is published from Portugal.

OMNewRotate 0.5.8 is out!

I’ve just released omnewrotate 0.5.8 which integrates Tim Abell’s improvements to rotation sensitivity and I’ve added some code so it is smarter about detecting the paths for setting the brightness level while rotating which changed in more recent Linuxs (2.6.32 and beyond, I think).

As I’m running SHR-Unstable, your mileage may vary but it’s likely it will work 🙂

As usual, the download links are at the project’s Google Code site for omnewrotate (see the featured downloads section):

SHR-Unstable users should only need to upgrade (later today, or in a day or so).

Enjoy!

OMNewRotate 0.5.7 is out!

After about 11 months since the previous release, I’ve just released omnewrotate 0.5.7 (after short lived 0.5.5 and 0.5.6 as I found out a dangling patch in SHR-Unstable’s recipe and did a mistake on the 0.5.6 release) which integrates Tim Abell’s init script change and the aforementioned patch.

As I’m running SHR-Unstable, your mileage may vary but it’s likely it will work 🙂

As usual, the download links are at the project’s Google Code site for omnewrotate (see the featured downloads section):

Enjoy!

OMNewRotate 0.5.4 is out!

Today I released omnewrotate 0.5.4, which fixes issues 5 and 6

As I am testing the latest 2009 test image, I’m glad to announce that it still works fine with current FSO, but Paroli looks really bad when it goes landscape.

I’ve also added a “-p” (for powersaving) flag, oriented towards activating, well, more conservative approaches such as reading the accelerometer data not so frequently (which directly implies less responsiveness, but it was asked for).

As usual, the download links are at the project’s Google Code site for omnewrotate (see the featured downloads section):

Enjoy!

OMNewRotate 0.5.3 is out!

Today I released omnewrotate 0.5.3, which fixes issue 4.

As I was starting to investigate libframeworkd-glib, that dependency was a problem for usage in the recently released Om2008.12 (basically, it wouldn’t run at all).

As such, I added a “–without-frameworkd” to the ./configure script, which I used for building the ipk of this release (OpenPGP sig).

Another good thing about this release, is that its tar ball (OpenPGP sig) is now the result of make dist. This should be a great bonus for integration with hackable:1, which is still using a pretty old version of omnewrotate. Just don’t forget to include “–without-frameworkd” in the configure process (I plan to have this detection done automatically in the future).

Enjoy!

OMNewRotate 0.5.1 is out!

Hi,

I’ve just release a new version of OMNewRotate (source, it’s OpenPGP signature, an ipkg tested agains FSO M4.1 and it’s OpenPGP signature), the ‘Automagically Lazy Edition’ because it’s just like the ‘Lazy Edition’ but with Autotools magic. Yes, I know it doesn’t work well with suspend. I’ve just gotter suspend to work on my OpenMoko, so expect that it is fixed by 0.6.0.

From the ChangeLog:

2008-12-09 - 0.5.1 - Automagically lazy
	* same as 0.5.0 plus auto tools magic
	* desktop icon
	* places a starter script

OpenMoko NewRotate 0.5.0 ‘Lazy Edition’ is out!

Hi,

I’ve just release a new version of omnewrotate (OpenPGP signature), the ‘Lazy Edition’ because it uses so much less CPU than any version I did before. Oh, I forgot to mention it in the release commit, but at least with FSO M4 I’m getting a very stable rotation BUT if the screen looks garbled, please wait a few seconds until the graphic user interface adjusts to the screen changes. I don’t think I can do much about that…

From the ChangeLog:

2008-11-19 - 0.5.0 - Lazy edition
        * uses a second thread for reading the accellerometer packets
        * drops Fabian's changes (not that they weren't good, just not
          needed any more)
        * adds flags (look at display_help() or ./rotate -h)
        * drops packets with 0 value coordinates (I got bogus packets
          like that so I decided to drop them, if you feel you get good
          packets with 0 value, you can use '-0' as an argument to take
          them in account).
        * top -d 1 -p PID shows 0.0% CPU usage (of omnewrotate) even
          during rotation
        * seems to waste a little too much memory (some stuff could be
          done with one number and bitwise operations instead of several
          numbers, I wonder how much that will improve and if it's worth
          the effort...)
        * only output outside of debug mode are real errors

OpenMoko newRotate checks brightness

Oscar Casamitja patched the old rotate program to change brightness on rotate in order to better hide xrandr’s artifacts. That’s actually a very good idea.

This new version reads from actual_brightness and set into brightness, which you can find in /sys/class/backlight/pcf50633-bl/ , in order to skip packet reading when the screen is dimmed, which is the next best thing to checking wether the screen is locked.

I run into a problem, though: it seems that if I open() actual_brightness once, I never again read an updated value, which makes me have to read on every loop 🙁

Enough talk, get it here: rotate-0.3.0.tar.gz (ascii sig) [now, if only this bug was fixed on projects.openmoko.org…]

Hope you’re enjoying it… 🙂

$ head -2 ChangeLog
2008-10-14 - 0.3.0
	* dims while rotating and doesn't rotate if dimmed, sleeping for 5s
$ cat KNOWN_ISSUES
Known Issues:
	* I'm not getting updated results if I only open
	  /sys/class/backlight/pcf50633-bl/actual_brightness once
	  which means I need to open it on every cycle.
	  Since it's in memory and not an actual file, wast should
	  not be too much
	* some heuristic values may need fine tunning

OpenMoko Rotate 0.2.1

Yes, it’s out, release early, release often, yadada yadada. I’m grumpy because of less sleep time than usual, and a whole day of ITIL Foundation V3 lesson (3 more days of it, plus an exam later on).

Get it here: rotate-0.2.1.tar.gz (signature)

Anyway, here’s the good news:

$ head -5 ChangeLog
2008-09-22 - 0.2.1
        * more heuristic fixes (hopefully really fix when laying around, and
          turned up)
        * workaround with alarm() for the accelerometer read-hang problem
        * sleeping for 100ms seems to get cpu usage quite low (0% to 0.9%)