GAPPLICATION(1) | User Commands | GAPPLICATION(1) |
NAME
gapplication - D-Bus application launcherSYNOPSIS
gapplication help [COMMAND]
gapplication version
gapplication list-apps
gapplication launch APPID
gapplication launch APPID [FILE...]
gapplication list-actions APPID
gapplication action APPID ACTION [PARAMETER]
DESCRIPTION
gapplication is a commandline implementation of the client-side of the org.freedesktop.Application interface as specified by the freedesktop.org Desktop Entry Specification.COMMANDS
Global commands
help [COMMAND]
Displays a short synopsis of the available commands or provides detailed help on a specific command.
Prints the GLib version whence gapplication came.
Prints a list of all application IDs that are known to support D-Bus activation. This list is generated by scanning .desktop files as per the current XDG_DATA_DIRS.
Launches an application.
The first parameter is the application ID in the familiar "reverse DNS" style (eg: 'org.gnome.app') without the .desktop suffix.
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.
List the actions declared in the application's .desktop file. The parameter is the application ID, as above.
Invokes the named action (in the same way as would occur when activating an action specified in the .desktop file).
The application ID (as above) is the first parameter. The action name follows.
Optionally, following the action name can be one parameter, in GVariant format, given as a single argument. Make sure to use sufficient quoting.
EXAMPLES
From the commandline
Launching an application:gapplication launch org.example.fooview
gapplication launch org.example.fooview ~/file.foo
gapplication launch org.example.fooview ~/foos/*.foo
gapplication action org.example.fooview create
gapplication action org.example.fooview show-item '"item_id_828739"'
From the Exec lines of a .desktop file
The commandline interface of gapplication was designed so that it could be used directly from the Exec line of a .desktop file.[Desktop Entry]
Version=1.1
Type=Application
Name=Foo Viewer
DBusActivatable=true
MimeType=image/x-foo;
Exec=gapplication launch org.example.fooview %F
Actions=gallery;create;
[Desktop Action gallery]
Name=Browse Gallery
Exec=gapplication action org.example.fooview gallery
[Desktop Action create]
Name=Create a new Foo!
Exec=gapplication action org.example.fooview create
From a script
If installing an application that supports D-Bus activation you may still want to put a file in /usr/bin so that your program can be started from a terminal.#!/bin/sh
case "$1" in
--help)
echo "see 'man fooview' for more information"
;;
--version)
echo "fooview 1.2"
;;
--gallery)
gapplication action org.example.fooview gallery
;;
--create)
gapplication action org.example.fooview create
;;
-*)
echo "unrecognised commandline argument"
exit 1
;;
*)
gapplication launch org.example.fooview "$@"
;;
esac
SEE ALSO
Desktop Entry Specification[1], gdbus(1), xdg-open(1), desktop-file-validate(1)GIO |