Distributing a Desktop GUI application for Linux while reaching the widest possible audience is complicated. Typically, the user has to make sure the correct version of the GUI toolkit is installed and configured. When a Linux distribution changes the delivered GUI toolkits, this can be problematic for applications.
Snaps solve these problems and ensure the correct toolkit libraries are shipped alongside the application at all times.
Read the documentation of the GUI toolkit your application uses in order to get started!
lzo
to make your application start up even quicker.Compared to CLI apps, desktop apps typically require three additional features.
Since snap apps are completely sandboxed by default, they cannot play sound, create notifications, or access the X server to display itself. However, it’s easy to make this possible by using the desktop interfaces. These allow you to “poke holes” in the sandbox, to give your application selected access to the host system.
The sandbox also means that your app cannot use the GUI toolkits of the host system. The snap either has to include the toolkit in the snap itself, or it needs to connect to a snap that provides these toolkits. Many toolkits and general desktop features such as fonts and themes also require initialization before the application can start. The extensions make this as easy as possible. They provide parts to bundle or access common GUI toolkits in your snap and a desktop-launch
script which does the required initialization for you.
These methods are not recommended anymore but might be useful as reference.
desktop-helpers
snapcraft-desktop-helpers
provided useful parts and launchers for desktop snaps, but these are deprecated in favor of the gnome-*
and kde-neon
extensions.Last updated 3 years ago.