Getting ready for stable


#1

Snaps can be released in the store to one or more channels. By default only the stable channel is publicly searchable.

One byproduct of this is developers can ‘hide’ unfinished applications, or snaps which aren’t production quality from users. However, once an application hits the stable channel, users will have expectations for functionality and presentation.

This page details some tips on getting your application ready for the stable snap store channel. Consider it a checklist of best practices for landing in the stable channel.

Confinement

Snaps in the stable channel must either conform to strict confinement, or with approval, classic confinement. In general applications should be using strict confinement.

In the event an application cannot be strictly confined, we recommend starting a thread on the forum to discuss a way forward. If classic is required, check the process for reviewing classic confined snaps to check if an exception can be made, and then start a request thread on the forum.

Interfaces

When strictly confining your application, ensure you’ve specified all required interfaces. You may have specified interfaces which are not auto-connected. If you believe they should be automatically connected on end-user computers, start a thread on the forum requesting them.

Those will each be discussed and reviewed in the open. In the event they’re approved, a store assertion will be setup so users installing your snap do not need to manually snap connect those interfaces.

Aliases

If the snap contains only one binary exposed to the host, and that binary has the same name as the snap, there is nothing to do here. For example the pulsemixer contains only the pulsemixer binary.

However if you want the snap to expose multiple binaries to the host system, they will by default all be prefixed with the snap name. So a snap called atom which contains two binaries - atom and apm will by default expose atom and atom.apm to the host where the snap is installed.

In this case an alias for apm was requested for the atom snap so users can invoke the apm command via apm directly.

Presentation

Store Icon

The snap store supports a single icon for the application, which should be a 256x256 png. The icon can be manually uploaded on the “listing” page of your published snaps or automatically by adding it to the icon key in snapcraft.yaml. This icon will show in the snapcraft.io store pages and other graphical store fronts such as the Ubuntu Software Center.

Desktop Icon

If the application is a graphical desktop app, then the snap should ship with an icon and .desktop file so that it will appear in the desktop menu. See desktop files for menu integration for more information on how to do this.

Screenshots

The snap store supports uploading multiple screenshots. End users wil see those screenshots in desktop applications such as GNOME Software. We recommend uploading at least one, and up to four screenshots via the dashboard.

Banner

An optional banner may be shown in GNOME Software when an application has been selected by the store admins to be featured. The banner should be uploaded in the same place as other screenshots, but must be called banner.png or banner.jpg and must be 1218x240 pixels in size.

Uploading a banner does not guarantee the application will be featured, but if it is, the banner will improve the appearance.

Example banner:

image

Banner Icon

If uploaded, the banner icon will be overlayed on top of the banner on the left of the banner image, when displayed in GNOME Software. The banner icon should be uploaded in the same place as other screenshots, but must be called banner-icon.png or banner-icon.jpg and its height should be below 240 pixels.

Example banner icon:

image

How this looks in GNOME Software.

image

Description

The application description is shown in the graphical snap store, via snap info and on the snapcraft.io store pages. It should accurately describe the application.

The contents originates in the snapcraft.yaml description: field, and can be updated via the snapcraft push-metadata command. In addition, the description can be maintained in the store dashboard.

Support link

The support link in the store enables users to provide feedback about your application. It should point to a support site, forum or bug tracker. This field is maintained in the store dashboard General -> Edit -> Contact URL.


What are the valid filenames in /snap/gui?
Restrictions on screenshots and videos in snap listings
Snap documentation
Application icon doesn't work in the launcher
Proposal: The `apps.<app-name>.icon` Key
#2

Does that mean I/upstream have to always keep a copy of the upstream’s .desktop file at /snap/gui/_snap_name_.dekstop and keep syncing with the original? That doesn’t sound very sane to me…

From: Application icon doesn't work in the launcher


#3

Also IMHO this topic’s title is quite misleading, it should be renamed to be clear on what contents it presents. For example, I never clicked into it until it appears in my search results(and it is my second attempt to find an answer to the desktop entry icon problem).


#4

What is the filename specification of the banner icon?


#5

Here you go, it’s covered at Getting ready for stable


#6

I only found this one:

I suppose the banner and the banner icon are separate files?


#7

yes, banner.png is the big one, and banner-icon.png is the smaller one.

e.g. for spotify, here’s the banner. https://dashboard.snapcraft.io/site_media/appmedia/2017/12/banner_dSwF9EF.png

and here’s banner-icon https://dashboard.snapcraft.io/site_media/appmedia/2017/12/banner-icon_WaLCF17.png


#8

Does this means _app_name_ or _app_command_?


#9

name: foo

apps:
  foo:
    command: bin/foo-cli

The above example shows name and app being the same, resulting in a command called foo being exposed to the host.

name: foo

apps:
  foo-cli:
    command: bin/foo-cli

The above example will result in a foo.foo-cli app exposed to the host.

Does that make it clear?


#10

Yes, thanks!

The issue is that I found some topics claiming the snap_name has to be the same as the command_name but not the app_name.


#11

What about snaps with multiple apps?


#12

Same question. Any answer? My app looks good on the website: https://snapcraft.io/solarus

But the .desktop file takes precedent in the software center, which isn’t what I want. I want the metadata from Snapcraft.io.


#13

Is that still true?..


#14

Is there a way to get the link of our snap’s banner? I cannot find a way to check that banner has been properly taken into account, once uploaded it “disappears” from the screenshot section.


#15

The only way I got the desktop icon to work was to manually copy the .desktop and .png files using the dump plugin.

  copy-desktop-icon-stuff:
    plugin: dump
    source: snap/gui
    organize:
      pynsource.png: usr/share/applications/pynsource.png
      pynsource.desktop: usr/share/applications/pynsource.desktop

I also had to “organize” the files, otherwise the two files end up in /prime not /prime/usr/share/applications/

I also had to rearrange my source code directory structure so that the snapcraft.yaml file was located in a directory snap and the .desktop and .png files were located in snap/gui. I had previously kept my snapcraft.yaml in the root of my project, and simply had a gui subdirectory containing the .desktop and .png files. This failed to create the entries

squashfs-root/meta/gui/pynsource.png
squashfs-root/meta/gui/pynsource.desktop
squashfs-root/snap/gui/pynsource.png
squashfs-root/snap/gui/pynsource.desktop

and as such, my app’s icon was blank. My .desktop file by the way looks like:

[Desktop Entry]
Name=Pynsource
GenericName=UML application
Comment=Pynsource UML reverse engineer Python source into diagrams
Exec=pynsource
Icon=${SNAP}/meta/gui/pynsource.png
Terminal=false
Type=Application
Categories=Development;
StartupNotify=true

I was also confused for many hours by the different and contradictory information found on the topic of creating desktop icons for a snapcraft app. This post is the closest it seems, to an official bit of documentation (albiet needing the extra steps I have outlined above). There are in the wilds of the internet:

  • posts that refer to icon files needing to be specified in the snapcraft.yaml - this doesn’t seem to be needed in order to define a desktop icon. The official doco says icon means an icon “Path to icon image that represents the snap.” which is quite a vague statement and could be improved.
  • a post by Michael that refer the desktop: share/applications/ rather than desktop: usr/share/applications/ location
  • posts about whether or not the desktop or desktop-legacy plugs are needed (I added them, to be safe)
  • multiple posts from Lin about additional patching being required to make the icon visible, with links to sed and bash scripts and associated entries to snapcraft.yaml - even an official proposal to enhance snapcraft. And even a snapcraft template that looks pretty impressive that adds good info, but also further confused me re how all this works.
  • numerous other posts trying to help with setting up snap desktop icons, with different and contradictory information - some of which preceded 2018. The above items are all 2018 and later, however

In summary:

  • following the instructions in this post do not work unless you add a dump plugin part - otherwise you get Failed to generate snap metadata: The path '/root/prime/usr/share/applications/pynsource.desktop' set for 'desktop' in 'pynsource' does not exist. Make sure that the files are in the prime directory.
  • you must follow the snap/gui directory structure, (not just a gui subdirectory underneath the snapcraft.yaml file location) or else .../meta/gui/ and .../snap/gui/ files are not created.

#16

Thanks for your feedback!

I added an documentation page specifically about .desktop launchers: Desktop files for menu integration

I also updated the reference explanation of the icon key to better explain that this is only used for the snap store, not for the desktop launch menu.: https://snapcraft.io/docs/snapcraft-top-level-metadata#heading--icon

Let me know if this stuff is still unclear.