Sailfish OS ‑ Applications

Email

Recently (?) the HTML view of emails became tiny, and zooming does not work properly either. The size can be adjusted by editing ~/.cache/com.jolla/email/.mozilla/prefs.js, adding or editing this line:

user_pref("layout.css.devPixelsPerPx", "3.0");

If your eyes are better than mine, "2.0" might be sufficient. This makes the text bigger and strangely also fixes the zooming problem.

Also see here.

While I was at it I reduced the glaring white bakground:

user_pref("browser.display.background_color", "#DDDDDD");

Stock Browser

A.k.a "sailfish-browser".

The browser is based on an older Firefox version. Basic settings are accessed through a hamburger menu in the bottom right (and not via pulldown as usually in Silica apps). But about:config is also accessible (and all the various about's) which makes this browser just as customisable as any other Firefox.

Use other/more search engines

None of the below is required anymore. You just need to visit say duckduckgo.com, open browser settings, then search engines and tap to install (source).

Install the Search engines manager from OpenRepos.net, which allows you to search, add & remove search engines. If that's your choice you can skip the rest of this chapter.

Before I found this app, I did it manually: download this file (that's for duckduckgo, but similar files exist for practically every search engine), and move it to this location: /usr/lib/mozembedlite/chrome/embedlite/content/duckduckgo.xml. This will require root privileges. Open a (local or remote) terminal and use devel-su, then (assuming you downloaded the XML file with your browser):

mv /home/defaultuser/Downloads/opensearch.xml /usr/lib/mozembedlite/chrome/embedlite/content/duckduckgo.xml

Credits go to this answer.

While I was there I also deleted all undesired search engines. The browser is clever enough to accept the changes, URL bar searches go straigh to duckduckgo now, and duckduckgo is currently the only option in the Settings' search engine dropdown.

Possible fix for crashes

Sometimes the browser crashes. On one site it even crashes the phone. Here's possibly a fix (also read subsequent posts, this one might be overkill). At least for that particular site (and later one other), it worked.

Situations

Can be installed from the official Jolla store. It is very useful: it performs certain actions if certain conditions are met.
The possibilities are boundless and it works reliably once conditions and actions have been tested carefully. Plugins both for conditions (When) and actions (What) can be downloaded and de/activated separately.

Usage examples:

Home

A situation to switch between WiFi and mobile data depending on whether I'm home or moving about. This is possible even without GPS, based on mobile cell towers.

When: Network cells = 8 cells
To achieve best results, keep recording at home while switching Network modes between 2/3/4G in Settings => Mobile network. Initially only two cells were recognized, but I got it up to 8 cells. This means that my "Home" condition extends ~0.5km around my home. Carefully re-recording with stricter conditions will probably help get that circle smaller while still working reliably - the "Home" condition must stay active while I'm actually at home, but I don't care so much about the large radius because I live in a residential area and "bad" access points are far away.

What: WiFi state = On
The developer ensures me that Situations remembers the state WiFi was in the moment the application starts. Meaning: make the application inactive through its Settings dialog, then make sure WiFi is actually off in Settings => WLAN, then make Situations active again.
Now Situations will enable WiFi when it finds any of the 8 mobile network cells recorded (and autoconnect to your home WiFi if SailfishOS is so configured) and disable WiFi when none of the 8 cells can be reached anymore.

Charging

A situation to start the Battery Buddy application when a charger is connected. Battery Buddy could just run all the time as a daemon, but I wanted to get this to work to save a little on resources, and as a proof of concept to launch any command through Situations.

When: Accessory = Charger
This means: when a charger is connected or when the device is connected to a computer via USB.

What: Command (1) AND Command (2) At situation end
I am calling the same script with a START or STOP argument:

sh
#!/bin/bash exec > "$HOME/situations/situations-batterybuddy.txt" 2>&1 echo "$(whoami) on $(date)" case $1 in START*) echo "It's the start condition!" if /sbin/pidof harbour-batterybuddy-daemon ; then echo "no action, harbour-batterybuddy-daemon is already running" else echo "launching harbour-batterybuddy-daemon" /usr/bin/harbour-batterybuddy-daemon & disown fi ;; STOP*) echo "It's the stop condition!" if /sbin/pidof harbour-batterybuddy-daemon; then echo "killing harbour-batterybuddy-daemon" /usr/bin/killall -vw harbour-batterybuddy-daemon else echo "not killing harbour-batterybuddy-daemon because it is not running" fi ;; esac

It's very chatty.

Save it to where-ever and make it executable: chmod +x batterybuddy.

While inputting the path to the script be very careful, no extra newlines at the end, and use the full path. E.g.

/home/defaultuser/situations/batterybuddy START

If it doesn't work for some reason, check ~/.local/share/harbour-situations2application/harbour-situations2application/situations2/situations.json. You can edit this file manually (after disabling the application).

Also see this section of the Situations forum thread.

Android apps

It's possible to install them both from an app store - I installed the F-droid app store - or from .apk files. Also see this article.

App Settings and Permissions (also globally)

This article cites two methods; I'm particulalry interested in the latter, which allows me to change permissions for all apps. It's not exactly a whitelist method, but it will do. I want my Android apps to be separate from the rest of the system.
From the terminal app or ssh:

$> apkd-launcher com.android.settings

This should pop up the GUI on your screen. Go to Apps & notifications => Permission manager and make your adjustments.