~mil/sxmo-tickets#248: 
Mechanism for autostarting arbitrary group of apps

It looks like all of the things that sxmo needs to run on startup are launched in sxmo_xinit.sh, which is fine for the sxmo essentials.

However, some devices (librem 5) need some extra apps running (e.g. wys for routing call audio). In other UIs in pmOS, we put a .desktop link to those in /etc/xdg/autostart, and those UIs honor the xdg autostart spec. Has there been any thought about having a utility in sxmo that would autostart things according to the xdg autostart spec too, so that distros (like pmOS) that install apps that some devices need to be running on startup could do that without having to make changes to sxmo_xinit.sh each time?

Status
REPORTED
Submitter
~craftyguy
Assigned to
No-one
Submitted
4 months ago
Updated
4 months ago
Labels
bug

~craftyguy 4 months ago

XDG autostart spec: https://specifications.freedesktop.org/autostart-spec/autostart-spec-latest.html

I found some implementations of this that might be good to use here:

xdg-autostart (very few dependencies, but written in vala.....): https://github.com/fabriceT/xdg-autostart

i3-autostart (written in go...): https://github.com/cking/i3-autostart

Fluxbox xdg autostart app (might be too specific to fb?): https://github.com/paultag/fbautostart

xdg-autostart-launcher (claims no external dependencies, written in C++): https://github.com/sandsmark/xdg-autostart-launcher

dex (python...): https://github.com/jceb/dex

Rather than writing a new tool for this, maybe one of these would work? (or something else I haven't found in the ~30min I searched around)

~anjan 4 months ago

There hasnt been thought into an utility "install apps that some devices need to be running on startup". We always want to respect the XDG spec and the conventions set by pmOS. Any implementation solving this issue provided it's relatively easy to maintain would be accepted.

If I had to choose something already written, the python and go implementation look good.

I would prefer something written in shell script or C as it would work well with the rest of the project and wouldnt require additional dependancies. Doing a quick glance of the go implementation of the autostart spec, it opens the autostart directory, calls the xdg library to parse *.desktop files, and then launches said files. That shouldnt be too hard to do with a shell script since we have shell code for parsing *.desktop files. You can take a look at the code in ./scripts/core/sxmo_open.sh in the sxmo-utils repo. You might have to extract the code out of and refactor so it can be used by your implementation AND sxmo_open.sh.

Register here or Log in to comment, or comment via email.