Request for classic confinement: vs-tray

My application, vs-tray, is a application to create a shortcut in system tray (for linux, windows and in the future, mac), for developers to access more easily their projects on vs code and, on github desktop. To do so, i basically spawn code and github desktop and the path for the project as arg. It works well with .deb, but with snap, it only works with classic confinement.
Built with electron, (that is because i’m javascript developer, so this is the easiest way to initiate in open source desktop development), the application is open source.

Can you provide an example invocation and the result (including location and the contents of the desktop file)?

You can see Here

This is the code to open vscode (code) in the given project path.

{
        label: locale.openCode,
        click: () => {
          spawn('code', [path], { shell: true });
        },
},

Contents of the desktop file:

[Desktop Entry]
Name=VS Tray
Comment=Open your Projects from tray menu on Visual Studio Code, and other useful options.
Exec=vs-tray
Terminal=false
Type=Application
Icon=${SNAP}/meta/gui/icon.png
StartupWMClass=VS Tray
Categories=Development;

Thanks, the Exec line looks ok, but where does this desktop file end up on the system?

it goes on /usr/share/applications

Writing to /usr/share/applications requires classic confinement since this path is not present in the runtime environment of the snap. The Exec line is ‘ok’ so long as the application uses something from /snap/bin for snaps, otherwise applications would be launched outside of confinement.

AIUI from this discussion, the application allows adding a ‘system tray’ to one’s desktop shell, and part of how this is done is that an electron application runs in the user’s session, displays things from desktop files it creates in /usr/share/applications and launches those items via electron/javascript (please correct me).

Even as classic, writing to /usr/share/applications requires root access, but it seems like the snap could run entirely within the user’s session by adding files to $HOME/.local/share/applications instead (which would require use of the personal-files interface instead of classic). Before making any changes to your snap, can you confirm my understanding of your application above and comment on use of $HOME/.local/share/applications?