nexmon – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | '\" t |
2 | .\" Title: gapplication |
||
3 | .\" Author: Ryan Lortie |
||
4 | .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/> |
||
5 | .\" Date: 04/27/2016 |
||
6 | .\" Manual: User Commands |
||
7 | .\" Source: GIO |
||
8 | .\" Language: English |
||
9 | .\" |
||
10 | .TH "GAPPLICATION" "1" "" "GIO" "User Commands" |
||
11 | .\" ----------------------------------------------------------------- |
||
12 | .\" * Define some portability stuff |
||
13 | .\" ----------------------------------------------------------------- |
||
14 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
15 | .\" http://bugs.debian.org/507673 |
||
16 | .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
||
17 | .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
18 | .ie \n(.g .ds Aq \(aq |
||
19 | .el .ds Aq ' |
||
20 | .\" ----------------------------------------------------------------- |
||
21 | .\" * set default formatting |
||
22 | .\" ----------------------------------------------------------------- |
||
23 | .\" disable hyphenation |
||
24 | .nh |
||
25 | .\" disable justification (adjust text to left margin only) |
||
26 | .ad l |
||
27 | .\" ----------------------------------------------------------------- |
||
28 | .\" * MAIN CONTENT STARTS HERE * |
||
29 | .\" ----------------------------------------------------------------- |
||
30 | .SH "NAME" |
||
31 | gapplication \- D\-Bus application launcher |
||
32 | .SH "SYNOPSIS" |
||
33 | .HP \w'\fBgapplication\fR\ 'u |
||
34 | \fBgapplication\fR help [\fICOMMAND\fR] |
||
35 | .HP \w'\fBgapplication\fR\ 'u |
||
36 | \fBgapplication\fR version |
||
37 | .HP \w'\fBgapplication\fR\ 'u |
||
38 | \fBgapplication\fR list\-apps |
||
39 | .HP \w'\fBgapplication\fR\ 'u |
||
40 | \fBgapplication\fR launch \fIAPPID\fR |
||
41 | .HP \w'\fBgapplication\fR\ 'u |
||
42 | \fBgapplication\fR launch \fIAPPID\fR [\fIFILE\fR...] |
||
43 | .HP \w'\fBgapplication\fR\ 'u |
||
44 | \fBgapplication\fR list\-actions \fIAPPID\fR |
||
45 | .HP \w'\fBgapplication\fR\ 'u |
||
46 | \fBgapplication\fR action \fIAPPID\fR \fIACTION\fR [\fIPARAMETER\fR] |
||
47 | .SH "DESCRIPTION" |
||
48 | .PP |
||
49 | \fBgapplication\fR |
||
50 | is a commandline implementation of the client\-side of the |
||
51 | org\&.freedesktop\&.Application |
||
52 | interface as specified by the freedesktop\&.org Desktop Entry Specification\&. |
||
53 | .PP |
||
54 | \fBgapplication\fR |
||
55 | can be used to start applications that have |
||
56 | \fIDBusActivatable\fR |
||
57 | set to |
||
58 | true |
||
59 | in their |
||
60 | \&.desktop |
||
61 | files and can be used to send messages to already\-running instances of other applications\&. |
||
62 | .PP |
||
63 | It is possible for applications to refer to |
||
64 | \fBgapplication\fR |
||
65 | in the |
||
66 | \fIExec\fR |
||
67 | line of their |
||
68 | \&.desktop |
||
69 | file to maintain backwards compatibility with implementations that do not directly support |
||
70 | \fIDBusActivatable\fR\&. |
||
71 | .PP |
||
72 | \fBgapplication\fR |
||
73 | ships as part of |
||
74 | GLib\&. |
||
75 | .SH "COMMANDS" |
||
76 | .SS "Global commands" |
||
77 | .PP |
||
78 | \fBhelp\fR [\fICOMMAND\fR] |
||
79 | .RS 4 |
||
80 | Displays a short synopsis of the available commands or provides detailed help on a specific command\&. |
||
81 | .RE |
||
82 | .PP |
||
83 | \fBversion\fR |
||
84 | .RS 4 |
||
85 | Prints the GLib version whence |
||
86 | \fBgapplication\fR |
||
87 | came\&. |
||
88 | .RE |
||
89 | .PP |
||
90 | \fBlist\-apps\fR |
||
91 | .RS 4 |
||
92 | Prints a list of all application IDs that are known to support D\-Bus activation\&. This list is generated by scanning |
||
93 | \&.desktop |
||
94 | files as per the current |
||
95 | \fBXDG_DATA_DIRS\fR\&. |
||
96 | .RE |
||
97 | .PP |
||
98 | \fBlaunch\fR \fIAPPID\fR [\fIFILE\fR...] |
||
99 | .RS 4 |
||
100 | Launches an application\&. |
||
101 | .sp |
||
102 | The first parameter is the application ID in the familiar "reverse DNS" style (eg: \*(Aqorg\&.gnome\&.app\*(Aq) without the |
||
103 | \&.desktop |
||
104 | suffix\&. |
||
105 | .sp |
||
106 | Optionally, if additional parameters are given, they are treated as the names of files to open and may be filenames or URIs\&. If no files are given then the application is simply activated\&. |
||
107 | .RE |
||
108 | .PP |
||
109 | \fBlist\-actions\fR \fIAPPID\fR |
||
110 | .RS 4 |
||
111 | List the actions declared in the application\*(Aqs |
||
112 | \&.desktop |
||
113 | file\&. The parameter is the application ID, as above\&. |
||
114 | .RE |
||
115 | .PP |
||
116 | \fBaction\fR \fIAPPID\fR \fIACTION\fR [\fIPARAMETER\fR] |
||
117 | .RS 4 |
||
118 | Invokes the named action (in the same way as would occur when activating an action specified in the |
||
119 | \&.desktop |
||
120 | file)\&. |
||
121 | .sp |
||
122 | The application ID (as above) is the first parameter\&. The action name follows\&. |
||
123 | .sp |
||
124 | Optionally, following the action name can be one parameter, in GVariant format, given as a single argument\&. Make sure to use sufficient quoting\&. |
||
125 | .RE |
||
126 | .SH "EXAMPLES" |
||
127 | .SS "From the commandline" |
||
128 | .PP |
||
129 | Launching an application: |
||
130 | .sp |
||
131 | .if n \{\ |
||
132 | .RS 4 |
||
133 | .\} |
||
134 | .nf |
||
135 | gapplication launch org\&.example\&.fooview |
||
136 | |||
137 | .fi |
||
138 | .if n \{\ |
||
139 | .RE |
||
140 | .\} |
||
141 | .PP |
||
142 | Opening a file with an application: |
||
143 | .sp |
||
144 | .if n \{\ |
||
145 | .RS 4 |
||
146 | .\} |
||
147 | .nf |
||
148 | gapplication launch org\&.example\&.fooview ~/file\&.foo |
||
149 | |||
150 | .fi |
||
151 | .if n \{\ |
||
152 | .RE |
||
153 | .\} |
||
154 | .PP |
||
155 | Opening many files with an application: |
||
156 | .sp |
||
157 | .if n \{\ |
||
158 | .RS 4 |
||
159 | .\} |
||
160 | .nf |
||
161 | gapplication launch org\&.example\&.fooview ~/foos/*\&.foo |
||
162 | |||
163 | .fi |
||
164 | .if n \{\ |
||
165 | .RE |
||
166 | .\} |
||
167 | .PP |
||
168 | Invoking an action on an application: |
||
169 | .sp |
||
170 | .if n \{\ |
||
171 | .RS 4 |
||
172 | .\} |
||
173 | .nf |
||
174 | gapplication action org\&.example\&.fooview create |
||
175 | |||
176 | .fi |
||
177 | .if n \{\ |
||
178 | .RE |
||
179 | .\} |
||
180 | .PP |
||
181 | Invoking an action on an application, with an action: |
||
182 | .sp |
||
183 | .if n \{\ |
||
184 | .RS 4 |
||
185 | .\} |
||
186 | .nf |
||
187 | gapplication action org\&.example\&.fooview show\-item \*(Aq"item_id_828739"\*(Aq |
||
188 | |||
189 | .fi |
||
190 | .if n \{\ |
||
191 | .RE |
||
192 | .\} |
||
193 | .SS "From the \fIExec\fR lines of a \&.desktop file" |
||
194 | .PP |
||
195 | The commandline interface of |
||
196 | \fBgapplication\fR |
||
197 | was designed so that it could be used directly from the |
||
198 | \fIExec\fR |
||
199 | line of a |
||
200 | \&.desktop |
||
201 | file\&. |
||
202 | .PP |
||
203 | You might want to do this to allow for backwards compatibility with implementations of the specification that do not understand how to do D\-Bus activation, without having to install a separate utility program\&. |
||
204 | .PP |
||
205 | Consider the following example: |
||
206 | .sp |
||
207 | .if n \{\ |
||
208 | .RS 4 |
||
209 | .\} |
||
210 | .nf |
||
211 | [Desktop Entry] |
||
212 | Version=1\&.1 |
||
213 | Type=Application |
||
214 | Name=Foo Viewer |
||
215 | DBusActivatable=true |
||
216 | MimeType=image/x\-foo; |
||
217 | Exec=gapplication launch org\&.example\&.fooview %F |
||
218 | Actions=gallery;create; |
||
219 | |||
220 | [Desktop Action gallery] |
||
221 | Name=Browse Gallery |
||
222 | Exec=gapplication action org\&.example\&.fooview gallery |
||
223 | |||
224 | [Desktop Action create] |
||
225 | Name=Create a new Foo! |
||
226 | Exec=gapplication action org\&.example\&.fooview create |
||
227 | |||
228 | .fi |
||
229 | .if n \{\ |
||
230 | .RE |
||
231 | .\} |
||
232 | .SS "From a script" |
||
233 | .PP |
||
234 | If installing an application that supports D\-Bus activation you may still want to put a file in |
||
235 | /usr/bin |
||
236 | so that your program can be started from a terminal\&. |
||
237 | .PP |
||
238 | It is possible for this file to be a shell script\&. The script can handle arguments such as \-\-help and \-\-version directly\&. It can also parse other command line arguments and convert them to uses of |
||
239 | \fBgapplication\fR |
||
240 | to activate the application, open files, or invoke actions\&. |
||
241 | .PP |
||
242 | Here is a simplified example, as may be installed in |
||
243 | /usr/bin/fooview: |
||
244 | .sp |
||
245 | .if n \{\ |
||
246 | .RS 4 |
||
247 | .\} |
||
248 | .nf |
||
249 | #!/bin/sh |
||
250 | |||
251 | case "$1" in |
||
252 | \-\-help) |
||
253 | echo "see \*(Aqman fooview\*(Aq for more information" |
||
254 | ;; |
||
255 | |||
256 | \-\-version) |
||
257 | echo "fooview 1\&.2" |
||
258 | ;; |
||
259 | |||
260 | \-\-gallery) |
||
261 | gapplication action org\&.example\&.fooview gallery |
||
262 | ;; |
||
263 | |||
264 | \-\-create) |
||
265 | gapplication action org\&.example\&.fooview create |
||
266 | ;; |
||
267 | |||
268 | \-*) |
||
269 | echo "unrecognised commandline argument" |
||
270 | exit 1 |
||
271 | ;; |
||
272 | |||
273 | *) |
||
274 | gapplication launch org\&.example\&.fooview "$@" |
||
275 | ;; |
||
276 | esac |
||
277 | |||
278 | .fi |
||
279 | .if n \{\ |
||
280 | .RE |
||
281 | .\} |
||
282 | .SH "SEE ALSO" |
||
283 | .PP |
||
284 | \m[blue]\fBDesktop Entry Specification\fR\m[]\&\s-2\u[1]\d\s+2, |
||
285 | \fBgdbus\fR(1), |
||
286 | \fBxdg-open\fR(1), |
||
287 | \fBdesktop-file-validate\fR(1) |
||
288 | .SH "NOTES" |
||
289 | .IP " 1." 4 |
||
290 | Desktop Entry Specification |
||
291 | .RS 4 |
||
292 | \%http://standards.freedesktop.org/desktop-entry-spec/latest/ |
||
293 | .RE |