Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
session_bus.h File Reference

A D-Bus session bus for an isolated session of the Hermes user. More...

#include <optional>
#include <string>
#include <string_view>
Include dependency graph for session_bus.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::optional< std::string > platf::session_bus::with_private_bus (std::string_view command, bool has_bus, std::string_view dbus_run_session)
 The command that starts an isolated session with a session bus of its own.

Detailed Description

A D-Bus session bus for an isolated session of the Hermes user.

Definition in file session_bus.h.

Function Documentation

◆ with_private_bus()

std::optional< std::string > platf::session_bus::with_private_bus ( std::string_view command,
bool has_bus,
std::string_view dbus_run_session )
inline

The command that starts an isolated session with a session bus of its own.

An isolated session must not see the desktop's bus: an application that registers as a unique instance would find the desktop's copy of itself there and hand its window over. Hermes removes that address, and a session with a uid of its own gets a bus from systemd. A session of the Hermes user gets none, and what needs one fails: Steam's runtime launcher exits with "Can't find session bus". dbus-run-session gives the session a private bus that lives exactly as long as it does, as the KWin session already has.

Parameters
commandThe session's command line.
has_busWhether the session's environment already names a bus.
dbus_run_sessionThe path of dbus-run-session, empty when it is not installed.
Returns
The command, wrapped when it needs a bus; nothing when it needs one and none can be started from a single command line.

Definition at line 31 of file session_bus.h.