If I don’t adddesktop field in apps, the .desktop file is copied to the meta/gui/ folder as a result it creates the icon on desktop, but it doesn’t work.
If I adddesktop: meta/gui/deletebg.desktop" I get the error:
Failed to generate desktop file: Invalid desktop file ‘meta/gui/deletebg.desktop’: does not exist (defined in the app ‘deletebg’).
There is no deletebg.desktop file in prime folder anywhere. But how can I to do this or what did I wrong?
Your Exec= value should match the command that would run your snap via the CLI, for example, the firefox snap would just put Exec=firefox there, I’d presume yours might just be Exec=deletebg
Just to be clear, is that error that the .desktop file still doesn’t work or that you get failed to generate .desktop file still.
You don’t need to have the desktop file entry in the yaml if you have the configuration you have in the top half of the post, in which case I’d have expected the Exec= change to have worked.
That’s it! You were right! we don’t need the desktop field in snapcraft.yaml if we have desktop configuration file. I just made a little typo in my exec command