Add support for snap autostart option #4237
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for
autostart
snap option. This allows snaps to define that they should be launched upon login.See https://snapcraft.io/docs/snap-format:
Basically, this just needs to set the value of
autostart
to the name of the.desktop
file that is created in$SNAP_USER_DATA/.config/autostart
. E.g. an "myapp" withsnap/myapp/current/.config/autostart/myapp.desktop
should have anautostart
ofmyapp.desktop
. The snap autostart helper will then pick this up and launch the app on login.For other package formats on linux I can simply use https://github.com/Teamwork/node-auto-launch, however this does not work for snaps. Hardcoding the value into the snap config itself is not ideal given autolaunch then can't be turned off, but at least this way you can turn it on at all if required.
I have tested this with my application and it is working perfectly.