Useful command-line settings

Settings that can't be reached from Sailfish OS graphical user interface.

Battery saving mode all the time

Sailfish OS (5.0) UI allows to start the battery saving mode / power saving mode at will from the Battery setting menu, and to set a threshold from which the battery saving mode is automatically enabled. This threshold can be chosen between 20%, 15%, 10%, 5%… But not higher than 20%.

Even if this mode isn't saving much battery, if you want to have it set all the time you can use this commands from the Terminal :

devel-su pkcon install mce-tools # to install the package that contains the mcetool command line program

mcetool --set-psm-threshold=100 --set-power-saving-mode=enabled --set-forced-psm=enable

This second line enables the power saving mode and sets it to auto-start from 100%. This way you'll be using your phone in power saving mode all the time except when it is plugged (loading the battery).

This setting is kept even after a reboot, just like if you had a 100% label available in the graphical Battery settings to click on.

This information have been summarized from this discussion : https://forum.sailfishos.org/t/please-add-function-for-automatic-power-saving-mode/7322

Blocking phone numbers from CLI in Sailfish OS

Blocking phone numbers from CLI in Sailfish OS

February 18, 2025 — Nico Cartron

With Sailfish OS 5, it is now possible to block incoming calls, which is especially useful for unwanted calls such as spam calls.

From the SFOS UI

Next time this number calls you, it will go directly to your voicemail, and you'll see it in the calls history with a "blocked" icon:

Using the CLI

You can also do this using SFOS CLI, which comes with the benefit of being able to also specify ranges of numbers - useful for countries where sales calls are due to originate from specific prefixes.

For instance in France, those numbers start with +33949 (and a bunch of other prefixes).

To block this range in SFOS, I would type the following command (as defaultuser user):

dconf write /sailfish/voicecall/filter/rejected-numbers ["'^+33949'"]

and to check that this was taken into account:

dconf read /sailfish/voicecall/filter/rejected-numbers

"Reject numbers" vs. "Ignore numbers"

If you're curious like me, you've probably seen that there are 2 options when it comes to filtering numbers in SFOS. If you enter that command:

dconf list /sailfish/voicecall/filter/

you'll get 2 answers:

ignored-numbers
rejected-numbers

We've used rejected-numbers above, now you may wonder what ignored-numbers is and what's the difference?

Well, fear not as I tested it for you:

Import settings for France

dconf write /sailfish/voicecall/filter/ignored-numbers "['', 'anonymous', '^+33162', '^+33163', '^+33270', '^+33271', '^+33377', '^+33378', '^+33424', '^+33425', '^+33568', '^+33569', '+3364466', '+3364467', '+3364468', '+3364469', '+337568', '+337569', '^+33806', '^+33948', '^+33949', '+5909475', '+5949476', '+2629478', '+2629479', '+5969477']"