dt.iki.fi

Sailfish OS ‑ Applications

This article has a parent article.

Stock Browser-up-

A.k.a "sailfish-browser".

Its settings are not accessed from a pulldown but from the main app menu => Settings => Apps => Browser. There isn't much. Most notably: no (to me) acceptable search engine.

But you can 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/nemo/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.

The browser is based on an older Firefox version and the various about's are accessible, also about:config, which makes this browser almost as customisable as any other Firefox.

Situations-up-

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-up-

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-up-

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:

#!/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/nemo/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-up-

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)-up-

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.