1
0
Fork 0
forked from wry/wry

config: allow running commands privileged

This commit is contained in:
Julian Orth 2024-04-01 13:16:34 +02:00
parent 4558bdb7c1
commit affea49e49
11 changed files with 74 additions and 5 deletions

View file

@ -82,6 +82,21 @@ impl Command {
self.fd(2, fd)
}
/// Runs the application with access to privileged wayland protocols.
///
/// The default is `false`.
pub fn privileged(&mut self) -> &mut Self {
match get!(self).get_socket_path() {
Some(path) => {
self.env("WAYLAND_DISPLAY", &format!("{path}.jay"));
}
_ => {
log::error!("Compositor did not send the socket path");
}
}
self
}
/// Executes the command.
///
/// This consumes all attached file descriptors.