blob: 8c5ef26d1b575b78a245246c4ac0b2d98000eb78 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
## Howto: A small guide on integration of your application
_Note: For the formal description, see the [[standard text|https://specifications.freedesktop.org/desktop-entry-spec/latest/]]_
If you are a developer and you develop an application that has a GUI, you may consider putting some effort into integrating your application with the desktop environment.
What you have to do, is to provide a .desktop file. Let's assume that you have an application Foo. Then your foo.desktop file could look like this:
[[!format txt """
[Desktop Entry]
Name=Foo
Comment=An amazingly useful program
Exec=foo
Icon=foo
Type=Application
Categories=Graphics;3DGraphics;
"""]]
You may want to pass `$ desktop-file-validate foo.desktop` to check out that your file is OK.
Then, you can install it: `desktop-file-install foo.desktop`
### Icons
If you want to use your icon without specifying the full path to it, it has to have the same name as the executable and you should put it in the appropriate place somwhere under the /usr/share/icons/ directory.
You will want to run `update-desktop-database` and/or `update-mime-database` after adding the .desktop file and storing the icon.
### Autotools
If you are using GNU Autotools, you will want to write this to Makefile.am:
[[!format txt """
desktopdir = $(datadir)/applications
desktop_in_files = appname.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@
"""]]
This is if you want to use translations (= little bit complicated), if not, just tell it to put the foo.desktop file to desktopdir.
|