D-Bus Activation

Applications that support being launched by D-Bus must implement the following interface (given in D-Bus introspection XML format):

  <interface name='org.freedesktop.Application'>
    <method name='Activate'>
      <arg type='a{sv}' name='platform_data' direction='in'/>
    <method name='Open'>
      <arg type='as' name='uris' direction='in'/>
      <arg type='a{sv}' name='platform_data' direction='in'/>
    <method name='ActivateAction'>
      <arg type='s' name='action_name' direction='in'/>
      <arg type='av' name='parameter' direction='in'/>
      <arg type='a{sv}' name='platform_data' direction='in'/>

The application must name its desktop file in accordance with the naming recommendations in the introduction section (e.g. the filename must be like org.example.FooViewer.desktop). The application must have a D-Bus service activatable at the well-known name that is equal to the desktop file name with the .desktop portion removed (for our example, org.example.FooViewer). The above interface must be implemented at an object path determined as follows: starting with the well-known D-Bus name of the application, change all dots to slashes and prefix a slash. For our example, this is /org/example/FooViewer.

The Activate method is called when the application is started without files to open.

The Open method is called when the application is started with files. The array of strings is an array of URIs, in UTF-8.

The ActivateAction method is called when Desktop Actions are activated. The action-name parameter is the name of the action.

All methods take a platform-data argument that is used in a similar way to how environment variables might be used. Currently, only one field is defined by the specification: desktop-startup-id. This should be a string of the same value as would be stored in the DESKTOP_STARTUP_ID environment variable, as specified by the Startup Notification Protocol Specification.