Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for snap autostart option #4237

Merged
merged 1 commit into from
Sep 23, 2019

Conversation

tom-james-watson
Copy link
Contributor

@tom-james-watson tom-james-watson commented Sep 13, 2019

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:

 # Name of the desktop file placed by the application in 
 # $SNAP_USER_DATA/.config/autostart to indicate that application 
 # should be started with the user's desktop session. The application
 # is started using the app's command wrapper (<name>.<app>) plus
 # any arguments  present in the Exec=.. line inside the autostart
 # desktop file.
 # (snapd 2.32.4+)
 autostart: <command line>

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" with snap/myapp/current/.config/autostart/myapp.desktop should have an autostart of myapp.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.

Add support for `autostart` snap option. This allows snaps to define
that they should be launched upon login.
@develar develar merged commit 9a5b950 into electron-userland:master Sep 23, 2019
adam-lynch added a commit to adam-lynch/electron-builder that referenced this pull request Jun 10, 2020
develar pushed a commit that referenced this pull request Jul 9, 2020
* Small cleanup of Snap documentation

* Note that summary defaults to the productName

* Document autoStart option from #4237

* Document new snap options (for #5073)

* Fix incorrect type
develar pushed a commit that referenced this pull request Sep 17, 2020
* Small cleanup of Snap documentation

* Note that summary defaults to the productName

* Document autoStart option from #4237
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants