We have moved to a new Sailfish OS Forum. Please start new discussions there.

autostart applications

asked 2013-12-24 19:41:42 +0200

Low gravatar image

updated 2015-03-17 18:00:16 +0200

chemist gravatar image

I was just wondering, with all those nice shields or what was the name again, wouldn't it be super cool to autostart applications like notes, todo, what's my IP or so, just like you know back then when we had widgets?

Or is there a feature for it already and I'm just not deep enough into my latest favorite dungeon, the settings? Well, and if not, would you have any pointers on where to mess around in /etc to get something like that done? (and on a side note, can I please have a shortcut to factory reset no questions asked somewhere?)

relevant tmo

edit retag flag offensive close delete



There is /etc/xdg/autostart/ but you need priviledges for writing there. You could try to soft link a desktop file to ~/.config/autostart but I have no idea if it would work:

mkdir ~/.config/autostart
ln -s /usr/share/applications/jolla-notes.desktop ~/.config/autostart
Tanghus ( 2013-12-24 20:11:51 +0200 )edit

thanks, I'll look into that. Still I think it'd be very cool to have this as a GUI option embedded in the launcher or so.

Low ( 2013-12-24 20:13:40 +0200 )edit

I just tested and it doesn't seem to work. Guess something else is required.

Tanghus ( 2013-12-24 20:21:36 +0200 )edit

additionally, see pinning covers/apps

AL13N ( 2013-12-25 13:38:43 +0200 )edit

IMHO this should be thought of as a case of User Session Management, where the state of chosen apps should be saved when signing of. On boot, the user session would be restored and all the applications internal states. Might be challenging to achive full "session awareness" in moblle platforms.

foss4ever ( 2013-12-25 23:23:20 +0200 )edit

3 Answers

Sort by » oldest newest most voted

answered 2014-01-07 09:16:27 +0200

Nux gravatar image

updated 2014-01-07 14:08:00 +0200

So until this is made as a settings application you can use the following instructions (developer mode required):

  1. Log in as user nemo (e.g. with WinSCP or PuTTy).
  2. In "/home/nemo/.config/" create "systemd".
  3. In "/home/nemo/.config/systemd/" create "user" and "scripts".
  4. Create "autostart-apps.service" (see below) in "user" dir.
  5. Create "autostart-apps" (see below) in "scripts" dir.
  6. Make the script executable: chmod u+x /home/nemo/.config/systemd/scripts/autostart-apps.
  7. Install autostart service: systemctl --user enable /home/nemo/.config/systemd/user/autostart-apps.service.
  8. Reboot and you should now see settings cover :-).

"autostart-apps.service" file:

Description=Run applications at startup



"autostart-apps" file:

#!/bin/sh -

invoker -n --single-instance --type=silica-qt5 /usr/bin/jolla-settings

Note that above will start settings. This is almost the same command as in "jolla-settings.desktop" shortcut (defined in "Exec" attribute), only difference is the "-n" parameter which is required for autostart.

Modify "autostart-apps" file to add more applications.

edit flag offensive delete publish link more


Looks good, gotta try this, thanks :)

foss4ever ( 2014-01-07 10:37:59 +0200 )edit

invoker in autostart seem to lock systemctl and Android apps are not starting :-/. I haven't figured out this yet...

Nux ( 2014-01-07 13:04:34 +0200 )edit

OK, it should work now - invoker by default waits for applications to exit. This behavior can be changed with "-n" parameter (as in the updated answer).

Nux ( 2014-01-07 14:10:17 +0200 )edit

If someone knows if it is possible to run a script after the Gallery system app has loaded and the SD card is mounted, it could be used here https://together.jolla.com/question/17691/camera-cant-store-pictures-to-sd-card/#post-id-57101 I tried several things based on this answer and this one https://together.jolla.com/question/5755/how-to-let-android-apps-to-write-to-real-sdcard/#post-id-35819 but it did not work.

baptx ( 2014-09-28 23:02:57 +0200 )edit

For some reason, I had problems with systemctl --user enable when using full absolute path, but succeeded after dropped the path and used only the file name. Anyway, having all this built into the system GUI would be great for users who don't want to hack things in CLI.

zagrimsan ( 2015-01-02 20:18:44 +0200 )edit

answered 2016-06-17 10:13:14 +0200

Schturman gravatar image

If someone still need it, I created app for this: https://openrepos.net/content/schturman/apps-after-boot

edit flag offensive delete publish link more

answered 2013-12-25 23:00:57 +0200

rainisto gravatar image

Currently we dont support 3rd party harbour apps to autostart itself. But in developer mode root you can use for example systemd to make your application to autostart on boot.

edit flag offensive delete publish link more



Please keep this in mind as feature request. The app should open and minimize at startup. Would be nice!

DerJott ( 2013-12-26 00:06:32 +0200 )edit

There is support in systemd for managing user session apps as well, but rainisto's answer implies the user UI is started using system wide unit files. I'll have a look tomorrow.

wstephenson ( 2013-12-26 01:13:00 +0200 )edit

And if we want to take this as far as to talk about session-management then it's not only to spesify which apps (auto)start, but to store the full users (application-spesfic) session data on exit, and restore it on start. Session-switch event could be reboot, or switching of TOH. ping: @AL13N

foss4ever ( 2013-12-26 01:47:39 +0200 )edit

in relation to security as well, and TOH management, this could be a very good feature for security/privacy aware people

AL13N ( 2013-12-26 02:43:19 +0200 )edit

well if 3rd party is not allowed to autostart themselves, what about me flagging them for autostart and jolla autostarting them? (in other ideas they call this "pinning")

Low ( 2013-12-26 10:57:46 +0200 )edit
Login/Signup to Answer

Question tools



Asked: 2013-12-24 19:41:42 +0200

Seen: 4,235 times

Last updated: Jun 17 '16