1
0
Fork 0
forked from wry/wry

config: allow spawning clients with tags

This commit is contained in:
Julian Orth 2026-02-27 21:00:20 +01:00
parent 8b19315f50
commit a1df575262
11 changed files with 80 additions and 7 deletions

View file

@ -22,6 +22,7 @@ pub struct Command {
pub(crate) args: Vec<String>,
pub(crate) env: HashMap<String, String>,
pub(crate) fds: RefCell<HashMap<i32, OwnedFd>>,
pub(crate) tag: Option<String>,
}
impl Command {
@ -37,6 +38,7 @@ impl Command {
args: vec![],
env: Default::default(),
fds: Default::default(),
tag: Default::default(),
}
}
@ -97,6 +99,12 @@ impl Command {
self
}
/// Adds a tag to Wayland connections created by the spawned command.
pub fn tag(&mut self, tag: &str) -> &mut Self {
self.tag = Some(tag.to_owned());
self
}
/// Executes the command.
///
/// This consumes all attached file descriptors.