Proposal: The `apps.<app-name>.icon` Key

Rationale

Currently, there’s no method to specify an icon for a specific app, a packager has to specifically patch each of the app’s corresponding desktop entries themselves, or if the snap only features an app with the same name, has to maintain a separate copy of patched desktop entry and icon as /snap/gui/_app_name_.desktop and /snap/gui/_app_name_.{png,svg} according to the Getting ready for stable - doc - snapcraft.io topic. This proposal tries to save the redundant work in order to make a snap app's desktop entry’s icon works as one expected to be.

Reference

Application icon doesn’t work in the launcher - snapcraft - snapcraft.io

Value Type

A YAML string

Value Description

A path relative to the prime directory pointing to a PNG/SVG icon, snapcraft should take care of the rest just like the apps.<app-name>.desktop key.

Expected Behavior

When this key and the apps.<app-name>.desktop key is specified, snapcraft should copy the desktop entry from apps.<app-name>.desktop to $SNAP/meta/gui/_app_name_.desktop, copy the icon from apps.<app-name>.icon to $SNAP/meta/gui/_app_name_.{png,svg}, do all necessary modifications to the new desktop entry file as it should be before, and replace/insert the Icon key’s value with the value $SNAP/meta/gui/_app_name_.{png,svg}.

3 Likes

Regular ping…

Regular bump…

I’d also like to see this. It could be used to fix: https://gitlab.com/solarus-games/solarus-snap/issues/2

also voting for this!