1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-09-15 19:26:58 +02:00

Merge pull request #1094 from JakeStanger/fix/launcher-regression

fix: regression caused by #1089
This commit is contained in:
Jake Stanger 2025-07-20 16:26:33 +01:00 committed by GitHub
commit 233f7f1ee2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 10 deletions

View file

@ -332,7 +332,7 @@ pub async fn open_program(file_name: &str, launch_command: &str) {
let launch_command_parts: Vec<&str> = expanded.split_whitespace().collect();
debug!("running {launch_command_parts:?}");
if let Err(err) = Command::new(launch_command_parts[0])
let exit_status = match Command::new(launch_command_parts[0])
.args(&launch_command_parts[1..])
.stdin(Stdio::null())
.stdout(Stdio::null())
@ -340,12 +340,24 @@ pub async fn open_program(file_name: &str, launch_command: &str) {
.kill_on_drop(true)
.spawn()
{
error!(
"{:?}",
Report::new(err)
.wrap_err("Failed to run launch command.")
.suggestion("Perhaps the desktop file is invalid or orphaned?")
);
Ok(mut child) => Some(child.wait().await),
Err(err) => {
error!(
"{:?}",
Report::new(err)
.wrap_err("Failed to run launch command.")
.suggestion("Perhaps the desktop file is invalid or orphaned?")
);
None
}
};
match exit_status {
Some(Ok(exit_status)) if !exit_status.success() => {
error!("received non-success exit status running {launch_command_parts:?}")
}
Some(Err(err)) => error!("{err:?}"),
_ => {}
}
}

View file

@ -104,9 +104,7 @@ where
let file_name = file_name.clone();
let command = command.clone();
glib::spawn_future_local(async move {
open_program(&file_name, &command).await
});
spawn(async move { open_program(&file_name, &command).await });
sub_menu.hide();
tx.send_spawn(ModuleUpdateEvent::ClosePopup);