From 8223a9ee6637495c860aa3531f1db02e8c5bd819 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Wed, 11 Sep 2024 16:35:23 +0900 Subject: [PATCH] enable filter in README example Signed-off-by: Ophestra Umiker --- README.md | 2 ++ dbus/config.go | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 7e286b2..ab49e2c 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ This adds the `environment.fortify` option: chromium.dbus = { configSystem = { + filter = true; talk = [ "org.bluez" "org.freedesktop.Avahi" @@ -91,6 +92,7 @@ This adds the `environment.fortify` option: ]; }; config = { + filter = true; talk = [ "org.freedesktop.DBus" "org.freedesktop.FileManager1" diff --git a/dbus/config.go b/dbus/config.go index dafcbae..9301f62 100644 --- a/dbus/config.go +++ b/dbus/config.go @@ -33,6 +33,9 @@ func (c *Config) Args(bus [2]string) (args []string) { args = make([]string, 0, argc) args = append(args, bus[0], bus[1]) + if c.Filter { + args = append(args, "--filter") + } for _, name := range c.See { args = append(args, "--see="+name) } @@ -51,9 +54,6 @@ func (c *Config) Args(bus [2]string) (args []string) { if c.Log { args = append(args, "--log") } - if c.Filter { - args = append(args, "--filter") - } return }