Fix invocation of xdg-dbus-proxy to include --filter arg

- This option was ommitted by mistake during some refactoring work and
  now the `exec` module in pacwrap has been revised to include this
  option.
- AppIndicator module has had the talk option re-added.
- Specifiying the `-v` option twice will invoke `--log` on
  xdg-dbus-proxy for easy debugging.
This commit is contained in:
Xavier Moffett 2024-09-23 17:59:39 -04:00
parent 07d3963196
commit 2f45f12b3e
Signed by: Sapphirus
GPG key ID: A6C061B2CEA1A7AC
2 changed files with 10 additions and 8 deletions

View file

@ -9,5 +9,6 @@ struct AppIndicator;
impl Dbus for AppIndicator {
fn register(&self, args: &mut ExecutionArgs) {
args.dbus("broadcast", "org.kde.StatusNotifierWatcher=@/StatusNotifierWatcher");
args.dbus("talk", "org.kde.StatusNotifierWatcher");
}
}

View file

@ -193,7 +193,7 @@ fn execute_container(ins: &ContainerHandle, arguments: Vec<&str>, shell: bool, v
}
if dbus {
jobs.push(instantiate_dbus_proxy(cfg.dbus(), &mut exec)?);
jobs.push(instantiate_dbus_proxy(cfg.dbus(), &mut exec, verbosity)?);
}
exec.env("XDG_RUNTIME_DIR", &XDG_RUNTIME_DIR);
@ -307,19 +307,20 @@ fn signal_trap(bwrap_pid: i32) {
.unwrap();
}
fn instantiate_dbus_proxy(per: &[Box<dyn Dbus>], args: &mut ExecutionArgs) -> Result<Child> {
fn instantiate_dbus_proxy(per: &[Box<dyn Dbus>], args: &mut ExecutionArgs, verbosity: i8) -> Result<Child> {
let dbus_socket_path = format!("/run/user/{}/bus", nix::unistd::geteuid());
let dbus_session = env_var("DBUS_SESSION_BUS_ADDRESS")?;
let mut dbus = Command::new(DBUS_PROXY_EXECUTABLE);
register_dbus(per, args)?;
create_placeholder(&DBUS_SOCKET)?;
dbus.arg(dbus_session).arg(&*DBUS_SOCKET);
match Command::new(DBUS_PROXY_EXECUTABLE)
.arg(dbus_session)
.arg(&*DBUS_SOCKET)
.args(args.get_dbus())
.spawn()
{
if verbosity > 1 {
dbus.arg("--log");
}
match dbus.arg("--filter").args(args.get_dbus()).spawn() {
Ok(mut child) => {
let mut increment: u8 = 0;