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:
commit
233f7f1ee2
2 changed files with 20 additions and 10 deletions
|
@ -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()
|
||||
{
|
||||
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:?}"),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue