10

I have a snapcraft application build on top of electronJs. I would like that application to run on startup.

I tried to directly drop a app_name.desktop file inside the current user config/autostart path but I was not able to do it from within my code, I got a right access issue which means I am not allowed to perform such action. I noticed inside the snap folder there is a .config. I thought that dropping my .desktop file there should work but nothing.

Is there a way to run my snap application on startup? Is there a command I should add to my .yml file or is there a way to do it directly from my code?

Here is my config

[Desktop Entry]
 Type=Application
 Terminal=false
 Exec=/snap/bin/rightplayer
 X-GNOME-Autostart-enabled=true
 StartupNotify=false
 Name=myapp

1 Answers1

11
  • Get the exact path of the snap location you wish to execute. You can do that by executing the following in the Terminal -

    which nameOfSnap
    /usr/bin/nameOfSnap    #copy this path
    
  • Search for "Startup Applications" from the Launcher enter image description here

  • Click on add. Paste the path in the command textbox. You can provide any name, comment. enter image description here

  • Click on "Add" at the bottom and the snap will be added to your startup applications.

Reference - How do I start applications automatically on login?

Niket Pathak
  • 263
  • 3
  • 9