Privacy policyContactsAbout siteOpinionsGitHubDonate
© EVILEG 2015-2018
Recommend hosting
TIMEWEB

SNAP Tutorial 03. Start snap application from a graphic environment

snap

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)

We recommend hosting TIMEWEB
We recommend hosting TIMEWEB
Stable hosting, on which the social network EVILEG is located. For projects on Django we recommend VDS hosting.

Comments

Only authorized users can post comments.
Please, Log in or Sign up
D
March 19, 2019, 9:57 a.m.
Damir

C++ - Test 001. The first program and data types

  • Result:73points,
  • Rating points1
ПМ
March 18, 2019, 3:12 p.m.
Пётр Махнёв

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:50points,
  • Rating points-4
ЯГ
March 18, 2019, 7:59 a.m.
Ян Греку

C++ - Тест 003. Условия и циклы

  • Result:21points,
  • Rating points-10
Last comments
March 16, 2019, 1:55 p.m.
Дмитрий

Спасибо за статью. Давно итересует следующий вопрос: с помощью переменных QMAKE_TARGET_COMPANYQMAKE_TARGET_PRODUCTQMAKE_TARGET_DESCRIPTIONможно задать свойства компилируемой программы, о...
JS
March 12, 2019, 10:19 a.m.
Jean Stefanovich

Большое спасибо за разъяснения!
March 12, 2019, 10:04 a.m.
Евгений Легоцкой

Hello, In fact, this functionality or is not implemented, or is not documented. I'm not sure. But I think, that it should be implemented in Text QML Type. Because of we can write text in...
March 12, 2019, 9:51 a.m.
Евгений Легоцкой

Да вы правы. На самом деле проще через QSqlQueryModel, сколько не пытался использовать эти дженерики типо QSqlTableModel и QSqlRelationalTableModel, то всегда упирался в какие-то их ограничени...
JS
March 12, 2019, 9:47 a.m.
Jean Stefanovich

Единицы измерения лежат там же где и названия продуктов. Просто в таблице ингредиенты нет ещё одного столбца, на который можно было бы установить setRelation. Я в итоге в базе создал ещё один ...
Now discuss on the forum
March 17, 2019, 10:47 p.m.
Евгений Легоцкой

Добрый день. Вот, нашлось у меня немного времени. Делается это через шаблон проектирования наблюдатель. GraphKS_mfvSlup.zip
ЧГ
March 15, 2019, 9:52 p.m.
Чарльз Грин

спасибо, попробую, отпишусь
m
March 15, 2019, 7:41 p.m.
mihamuz

Сори догадался)
n
March 12, 2019, 4:57 p.m.
newbie.works.with.QT

Большооооое спасибо!!!!!Не передать как я вам благодарен, спасибо что всегда отзываетесь.Теперь я смогу продолжить работу в QT!!! (пробую писать бота (Я как вы могли догадаться немного не пр...
March 12, 2019, 1:20 p.m.
BlinCT

Ну так если у вас есть готовая программа так ей и воспользуйтесь. Вы же написали ее вот и пользуйтесь.
Join us in social networks

For registered users on the site there is a minimum amount of advertising