summaryrefslogtreecommitdiff
path: root/scripts/man/xdg-menu.1
blob: e8daed00770000ce6c8b6756752b04bb81494786 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
.\"Generated by db2man.xsl. Don't modify this, modify the source.
.de Sh \" Subsection
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Ip \" List item
.br
.ie \\n(.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
.TH "XDG-MENU" 1 "" "" "xdg-menu Manual"
.SH NAME
xdg-menu \- command line tool for (un)installing desktop menu items
.SH "SYNOPSIS"
.ad l
.hy 0
.HP 9
\fBxdg\-menu\fR [\fB\-\-help\fR] [\fB\-\-vendor\ \fIvendor\-id\fR\fR] [\fB\-\-noupdate\fR] [\fB\-\-user\fR | \fB\-\-system\fR] [\fB\-\-install\ \fIdesktop\-file\fR\fR | \fB\-\-install\ \fIdirectory\-file\fR\fR | \fB\-\-install\ \fImenu\-file\fR\fR | \fB\-\-uninstall\ \fIdesktop\-file\fR\fR | \fB\-\-uninstall\ \fIdirectory\-file\fR\fR | \fB\-\-uninstall\ \fImenu\-file\fR\fR | \fB\-\-forceupdate\fR]
.ad
.hy

.SH "DESCRIPTION"

.PP
The xdg\-menu program can be used to install new items to the desktop's application menu\&.

.PP
The application menu works according to the XDG Desktop Menu Specification at http://www\&.freedesktop\&.org/Standards/menu\-spec

.SH "OPTIONS"

.TP
\fB\-\-help\fR
Show this help\&.

.TP
\fB\-\-vendor\fR \fIvendor\-id\fR
Adds \fIvendor\-id\fR as a prefix when installing desktop and directory files\&.

.TP
\fB\-\-noupdate\fR
Postpone updating the menu system\&. If multiple updates to the menu system are made in sequence this flag can be used to indicate that additional changes will follow and that it is not necassery to update the menu system right away\&.

.TP
\fB\-\-user\fR
Installs or uninstalls the file for the current user only\&.

.TP
\fB\-\-system\fR
Installs or uninstalls the file for all users on the system\&. Usually only root is allowed to do this\&.

.TP
\fB\-\-install\fR \fIdesktop\-file\fR
Installs the *\&.desktop file indicated by \fIdesktop\-file\fR to the menu system\&. A desktop file represents a single menu item\&.

.TP
\fB\-\-install\fR \fIdirectory\-file\fR
Installs the *\&.directory file indicated by \fIdirectory\-file\fR to the menu system\&. A directory file provides the name and icon for a submenu\&.

.TP
\fB\-\-install\fR \fImenu\-file\fR
Installs the *\&.menu file indicated by \fImenu\-file\fR to the menu system\&. A menu file describes a submenu\&.

.TP
\fB\-\-uninstall\fR \fIdesktop\-file\fR
Removes the *\&.desktop file indicated by \fIdesktop\-file\fR from the menu system\&.

.TP
\fB\-\-uninstall\fR \fIdirectory\-file\fR
Removes the *\&.directory file indicated by \fIdirectory\-file\fR from the menu system\&.

.TP
\fB\-\-uninstall\fR \fImenu\-file\fR
Removes the *\&.menu file indicated by \fImenu\-file\fR from the menu system\&.

.TP
\fB\-\-forceupdate\fR
Force an update of the menu system\&. This is only useful if the last call to xdg\-menu included the \fB\-\-noupdate\fR option\&.

.SH "EXAMPLES"

.PP
The company ShinyThings Inc\&. has developed an application named "WebMirror" and would like to add it to the application menu\&. The company will use "shinythings" as its vendor id\&. In order to add the application to the menu there needs to be a \&.desktop file with a suitable \fICategories\fR entry: 

.nf

webmirror\&.desktop:

  [Desktop Entry]
  Encoding=UTF\-8
  Type=Application

  Exec=webmirror
  Icon=webmirror

  Name=WebMirror
  Name[nl]=WebSpiegel

  Categories=Network;WebDevelopment;

.fi
 

.PP
Now the xdg\-menu tool can be used to add the webmirror\&.desktop file to the desktop application menu: 

.nf

xdg\-menu \-\-system \-\-vendor shinythings \-\-install \&./webmirror\&.desktop

.fi
 

.PP
Note that for the purpose of this example the menu items are available in two languages, English and Dutch\&. The language code for Dutch is nl\&.

.PP
In the next example the company ShinyThings Inc\&. wants to add its own submenu to the desktop application menu consisting of a "WebMirror" menu item and a "WebMirror Admin Tool" menu item\&.

.PP
First the company needs to create two \&.desktop files that describe the two menu items, this time no Categories item is needed: 

.nf

webmirror\&.desktop:

  [Desktop Entry]
  Encoding=UTF\-8
  Type=Application

  Exec=webmirror
  Icon=webmirror

  Name=WebMirror
  Name[nl]=WebSpiegel


webmirror\-admin\&.desktop:

  [Desktop Entry]
  Encoding=UTF\-8
  Type=Application

  Exec=webmirror\-admintool
  Icon=webmirror\-admintool

  Name=WebMirror Admin Tool
  Name[nl]=WebSpiegel Administratie Tool

.fi
 

.PP
The files can be installed with: 

.nf

xdg\-menu \-\-system \-\-noupdate \-\-vendor shinythings \-\-install \&./webmirror\&.desktop
xdg\-menu \-\-system \-\-noupdate \-\-vendor shinythings \-\-install \&./webmirror\-admin\&.desktop

.fi
 

.PP
Because multiple items are added the \fB\-\-noupdate\fR option has been used\&.

.PP
In addition a \&.directory file needs to be created to provide a title and icon for the sub\-menu itself: 

.nf

webmirror\&.directory:

  [Desktop Entry]
  Encoding=UTF\-8

  Icon=webmirror

  Name=WebMirror
  Name[nl]=WebSpiegel

.fi
 

.PP
This webmirror\&.directorty file can be installed with: 

.nf

xdg\-menu \-\-system \-\-noupdate \-\-vendor shinythings \-\-install \&./webmirror\&.directory

.fi
 

.PP
The last step is to provide a \&.menu file that links it all togther: 

.nf

webmirror\&.menu:

  <!DOCTYPE Menu PUBLIC "\-//freedesktop//DTD Menu 0\&.8//EN"
     "http://www\&.freedesktop\&.org/standards/menu\-spec/menu\-0\&.8\&.dtd">
  <Menu>
    <Menu>
      <Name>WebMirror</Name>
      <Directory>shinythings\-webmirror\&.directory</Directory>
      <Include>
        <Filename>shinythings\-webmirror\&.desktop</Filename>
        <Filename>shinythings\-webmirror\-admin\&.desktop</Filename>
      </Include>
    </Menu>
  </Menu>

.fi
 

.PP
The webmirror\&.menu file can be installed with: 

.nf

xdg\-menu \-\-system \-\-noupdate \-\-vendor shinythings \-\-install \&./webmirror\&.menu

.fi
 

.PP
After installing multiple files with \fB\-\-noupdate\fR make sure to force an update: 

.nf

xdg\-menu \-\-system \-\-forceupdate

.fi
 

.SH AUTHORS
Kevin Krammer, Jeremy White.