app/dbus: manage dbus proxy and pass address to child

This commit adds code that starts and registers the D-Bus proxy, as well as cleanup code that tracks and closes the daemon once our child exits. A few more flags were added to pass D-Bus config to xdg-dbus-proxy.

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
This commit is contained in:
2024-09-09 03:16:54 +09:00
parent 357cc4ce4d
commit 38ef2b4d0c
6 changed files with 142 additions and 7 deletions

View File

@@ -166,6 +166,9 @@ func (a *App) commandBuilderMachineCtl() (args []string) {
if executable, err := os.Executable(); err != nil {
state.Fatal("Error reading executable path:", err)
} else {
if a.enablements.Has(state.EnableDBus) {
innerCommand.WriteString(dbusSessionBusAddress + "=" + "'" + dbusAddress + "' ")
}
innerCommand.WriteString("exec " + executable + " -V")
}
args = append(args, innerCommand.String())