Adding default icon file into the snapcraft template yaml file

Bug #1638155 reported by XiaoGuo, Liu
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Software Center Agent
New
Undecided
Unassigned

Bug Description

Currently, when I use the ubuntu core store by entering <ip_address>:4200, I see a lot of listed snap apps without their customized icon in the apps. Although snaps running in a screen-less device may not need the app icon, it is useful to have an recognized icon for a specific application.

Some developers may not know how to create an icon for their snaps.I have found the solution in the article at https://github.com/snapcore/snapcraft/blob/master/docs/your-first-snap.md, but it may not be easy to find it for some developers.

I personally think a best solution is to create the "setup/gui" directory and put a default ubuntu icon there when using "snapcraft init" to create a template yaml file. If a developer later on wants to change a new one, it would be easy to replace it with his/her own. As such, a developer does not need to search for a solution on how to create his/her own app specific icon.

Also, I have made a PR to remove the following line

icon (string) Path to the icon that will be used for the snap.

at http://snapcraft.io/docs/build-snaps/syntax. This confuses to the developers since it never works on series 16.

Thanks & best regards,
XiaoGuo

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

The solution actually belongs in the store as the default icon can change with time.

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

The default icon today is a grayed out Ubuntu icon. If this is the case we can invalidate this bug.

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

We do not want to kill the icon entry, much rather fix it. Can you add a new buff detailing the problem as this works fine from out testing.

affects: snapcraft → software-center-agent
Revision history for this message
XiaoGuo, Liu (liu-xiao-guo) wrote :

Please find my code at https://github.com/liu-xiao-guo/helloworld-icon. In the code, I define an "icon" field in the example. When I build the example, it shows:

liuxg@liuxg:~/snappy/desktop/helloworld$ snapcraft
"grade" property not specified: defaulting to "stable"
DEPRECATED: The 'copy' plugin's functionality has been replaced by the 'dump' plugin, and it will soon be removed.
Preparing to pull hello
Pulling hello
Preparing to build hello
Building hello
Staging hello
Priming hello
DEPRECATED: 'icon' defined in snapcraft.yaml. Look at https://github.com/snapcore/snapcraft/blob/master/docs/metadata.md#snap-icon for more information
Snapping 'hello-xiaoguo' |
Snapped hello-xiaoguo_1.0_amd64.snap

It indicates that "DEPRECATED: 'icon' defined in snapcraft.yaml". The icon cannot be correctly reflected in the ubuntu store if it is installed.

However, if I define an icon in the "setup/gui", then the snap icon is shown correctly. If both ways work, I think there could be a duplication for the icon.

My idea is that we create a complete file layout for developer's use. It is up to the developers to come with the right icon file to overwrite the default one. The store does not need to change. Instead, when generating the template using "snapcraft init", we put the default file "icon.png" into the right place so that a developer can refer to the right location to overwrite it with the right file.

Hopefully, I have made myself understood.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.