DEV Community

Jan Mewes
Jan Mewes

Posted on • Updated on

Flutter: Linux: Snap Desktop Icon

This blog post describes how to add an icon to a Flutter Linux Desktop app.

It is assumed that Snapcraft is being used to compile and install the app, as explained in the Flutter documentation.

Goals

After installing the app, the app's icon should show up in the application menu.

Alt Text

Further, when the app is running, the app's icon should be in the launcher bar.

Alt Text

Snap configuration

This functionality has nothing to do with Flutter, but needs to be configured in the Snap level.

Withing the snap folder, create a gui subfolder. There create a desktop file, e.g. succedo.desktop. In the "Icon" row needs to be a reference to the Snap metadata.

[Desktop Entry]
Icon=${SNAP}/meta/gui/succedo.png
Exec=succedo
Version=1.0
Type=Application
Name=Succedo
Terminal=false
Enter fullscreen mode Exit fullscreen mode

The icon should be placed in the same directory as the desktop file. It can have either PNG or SVG format. For PNG images a file size of 256x256 pixels is recommended.

References

Top comments (0)