Firefox in Ubuntu Touch (Libertine)
Ubuntu Touch is an interesting alternative to Android and iOS. But the most critical app (for me), the browser, is feeling a bit underwhelming. Luckily, it brings a compatibility layer called Libertine to run desktop applications, which means it is relatively straightforward to install a normal desktop firefox. Or so I thought.
Ubuntu famously replaced the regular browser .deb packages with snap ones, and snap isn’t really supported on Ubuntu Touch. So we need to do a few extra steps. Also, I’m going to borrow the firefox mobile config, which originally came from postmarketOS, and is also used in Mobian/Debian.
All of this is tested on a Oneplus 6 with UT 20.04 (‘focal’).
- Install a Libertine container from the system settings, this will take a while
- In the container settings, add the ppa to get the .deb for firefox:
ppa:ubuntu-mozilla-security/ppa
- Open a libertine shell (
lish
, if you installed the Libtertine Tweak Tool), check ifapt update && apt install --dry-run firefox
wants to download the ppa version - In the container settings, install
firefox
- Now, opening FF from the app menu should successfully show a (very small) FF window. Close it for now.
- Manually download https://packages.debian.org/sid/firefox-esr-mobile-config
- Extract the archive (
ar x "firefox*.deb"
), thentar xf data.tar.xz
- Debian uses FF ESR, let’s fix that:
mv usr/lib/firefox-esr usr/lib/firefox
- Copy to the right places:
cp -r usr / && cp -r etc /
touch /etc/mobile-config-firefox/*/*.css
- Let’s fix proper touch screen scrolling:
echo "MOZ_USE_XINPUT2=1 /usr/bin/firefox $*" > /usr/local/bin/firefox && chmod +x /usr/local/bin/firefox
- The default postmarketOS/Mobian config puts the address bar at the
bottom. If you don’t like that, here’s how to change it: open
/etc/mobile-config-firefox/userChrome/browser.css
and comment out the#browser {...}
block (helpfully labeled in the comment)
Now, if you open firefox, it should be properly scaled, support touch scrolling, and thanks to the magic of Libertine, the on-screen keyboard works for me as well. Browsing performance is quite good, especially considering that there is no hardware acceleration yet.