GAPPLICATION - Online Linux Manual PageSection : 1
Updated :
Source : GIO
Note : User Commands

NAMEgapplication − D−Bus application launcher

SYNOPSISgapplication help [COMMAND] gapplication version gapplication list−apps gapplication launch APPID gapplication launch APPID [FILE...] gapplication list−actions APPID gapplication action APPID ACTION [PARAMETER]

DESCRIPTIONgapplication is a commandline implementation of the client−side of the org​.freedesktop​.Application interface as specified by the freedesktop​.org Desktop Entry Specification​. gapplication can be used to start applications that have DBusActivatable set to true in their ​.desktop files and can be used to send messages to already−running instances of other applications​. It is possible for applications to refer to gapplication in the Exec line of their ​.desktop file to maintain backwards compatibility with implementations that do not directly support DBusActivatable​. gapplication ships as part of GLib​.

COMMANDS

Global commandshelp [COMMAND] Displays a short synopsis of the available commands or provides detailed help on a specific command​. version Prints the GLib version whence gapplication came​. list−apps 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​. launch APPID [FILE...] 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−actions APPID List the actions declared in the application's ​.desktop file​. The parameter is the application ID, as above​. action APPID ACTION [PARAMETER] 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 commandlineLaunching an application: gapplication launch org​.example​.fooview Opening a file with an application: gapplication launch org​.example​.fooview ~/file​.foo Opening many files with an application: gapplication launch org​.example​.fooview ~/foos/*​.foo Invoking an action on an application: gapplication action org​.example​.fooview create Invoking an action on an application, with an action: gapplication action org​.example​.fooview show−item '"item_id_828739"'

From the Exec lines of a ​.desktop fileThe commandline interface of gapplication was designed so that it could be used directly from the Exec line of a ​.desktop file​. 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​. Consider the following example: [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 scriptIf 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​. 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 gapplication to activate the application, open files, or invoke actions​. Here is a simplified example, as may be installed in /usr/bin/fooview: #!/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 ALSODesktop Entry Specification[1], gdbus(1), xdg-open(1), desktop-file-validate(1)

NOTES 1. Desktop Entry Specification ­http://standards.freedesktop.org/desktop-entry-spec/latest/
0
Johanes Gumabo
Data Size   :   19,322 byte
man-gapplication.1Build   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   3 / 164,563
Visitor ID   :     :  
Visitor IP   :   3.129.71.13   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.