dbus-launch
Start a new D-Bus session bus instance
SYNOPSIS
dbus-launch [options] [--] [program] [arguments...]
PARAMETERS
--version
Display the version of the D-Bus library.
--help
Display a help message and exit.
--binary-syntax
Print the activation environment in a simple, easily-parsable format. Suitable for use in shell scripts. Not human-readable.
--exit-with-session
Normally, dbus-launch remains running and the session bus remains alive until the user logs out. With this option, dbus-launch will exit when the first process it launched (if any) terminates. This is useful for running a single session bus as part of a larger application, and stopping it when the application is complete.
[program] [arguments...]
The program to execute with the D-Bus session bus environment set up. If no program is given, dbus-launch will simply print the environment variables to standard output.
DESCRIPTION
The dbus-launch command is used to start a D-Bus session bus instance. D-Bus is a message bus system, a simple way for applications to talk to one another. It allows applications to communicate without needing to know the location, address, or implementation details of each other.
When executed, dbus-launch typically performs the following:
1. Starts a new D-Bus daemon process if one isn't already running.
2. Sets environment variables (DBUS_SESSION_BUS_ADDRESS, DBUS_SESSION_BUS_PID) so that applications know how to connect to the bus.
3. Executes the command passed to it, with the environment variables set. If no command is given, it prints the environment variables to standard output.
This command is essential for GUI applications that rely on D-Bus for inter-process communication and desktop integration. It ensures that these applications can connect to a session bus and participate in the desktop environment.
USAGE SCENARIOS
dbus-launch is commonly used in startup scripts (e.g., .xinitrc) or desktop environment startup processes to ensure that a D-Bus session bus is available for applications. It's often invoked implicitly by desktop environment components. If you need to manually start a D-Bus session bus instance for testing or specific application needs, dbus-launch is the tool to use.
SEE ALSO
dbus-daemon(1), dbus-send(1), dbus-monitor(1)