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

10
cli.go
View File

@@ -7,7 +7,10 @@ import (
)
var (
userName string
userName string
dbusConfig string
dbusID string
mpris bool
mustWayland bool
mustX bool
@@ -19,7 +22,10 @@ var (
)
func init() {
flag.StringVar(&userName, "u", "chronos", "Specify a username")
flag.StringVar(&userName, "u", "chronos", "Passwd name of user to run as")
flag.StringVar(&dbusConfig, "dbus-config", "builtin", "Path to D-Bus proxy config file, or \"builtin\" for defaults")
flag.StringVar(&dbusID, "dbus-id", "", "D-Bus ID of application, leave empty to disable own paths, has no effect if custom config is available")
flag.BoolVar(&mpris, "mpris", false, "Allow owning MPRIS D-Bus path, has no effect if custom config is available")
flag.BoolVar(&mustWayland, "wayland", false, "Share Wayland socket")
flag.BoolVar(&mustX, "X", false, "Share X11 socket and allow connection")