Greetings to all on the continuation of the topic of self-contained snap packages.
In today's part, we will discuss how to configure the application so that it can be launched not only in the console, but also in the graphical environment (KDE, GNOME, XFCE, and so on).
There are 2 options:
Option 1
This setup will require 2 files, managetime.desktop and managetime.png. We add these files to the snap / gui directory. That is, you just need to put these files in the correct directory, that's all.
The previous article showed the tree structure of directories and files based on my application.
Consider what is the managetime.desktop file.
[Desktop Entry] Encoding=UTF-8 Categories=Application for time management Comment=Applique for those who want to control their time Exec=managetime GenericName=Application for time management2 Icon=${SNAP}/meta/gui/managetime.png Name=TimerProject_desktop Type=Application Terminal=false
The most basic is 5 and 7 lines. Line 5 is the name of the application itself.
apps: managetime:
7 the same line indicates the path inside the snap package where the icon is located.
Also in this file there is a description of the application itself, whether to open it in the console or not.
Option 2
This option already works through the setting in the file snapcraft.yaml
We indicate among the other settings of the application, where we have the files.
name: managetime version: "0.1.0" summary: timer description: | Application for time management confinement: strict grade: stable architectures: [amd64] base: core18 icon: snap/gui/managetime.png apps: managetime: desktop: share/applications/managetime.desktop command: bin/projecttimer plugs: - home
As you can see, we have added 2 points:
- the first is the icon where the file remains in the same place.
-
But the app.desktop file has migrated to another directory and we have already through the desktop:
we specify its location.
How it works you can look at my finished application. snap
Thanks to all.
To be continued)