diff --git a/src/profile.rs b/src/profile.rs index d67a7ac..4a637fe 100644 --- a/src/profile.rs +++ b/src/profile.rs @@ -363,7 +363,6 @@ pub struct Profile { pub lighthouse_driver: LighthouseDriver, #[serde(default = "String::default")] pub xrservice_launch_options: String, - pub autostart_command: Option, #[serde(default)] pub skip_dependency_check: bool, } @@ -422,7 +421,6 @@ impl Default for Profile { lighthouse_driver: LighthouseDriver::default(), xrservice_launch_options: String::default(), uuid, - autostart_command: None, skip_dependency_check: false, } } @@ -543,7 +541,6 @@ impl Profile { mercury_enabled: self.features.mercury_enabled, }, environment: self.environment.clone(), - autostart_command: self.autostart_command.clone(), pull_on_build: self.pull_on_build, lighthouse_driver: self.lighthouse_driver, opencomposite_repo: self.opencomposite_repo.clone(), diff --git a/src/ui/app.rs b/src/ui/app.rs index 5e3cca4..5948153 100644 --- a/src/ui/app.rs +++ b/src/ui/app.rs @@ -43,8 +43,7 @@ use crate::{ restore_runtime_entrypoint, set_runtime_entrypoint_launch_opts_from_profile, }, util::file_utils::{ - mark_as_executable, setcap_cap_sys_nice_eip, setcap_cap_sys_nice_eip_cmd, - verify_cap_sys_nice_eip, + setcap_cap_sys_nice_eip, setcap_cap_sys_nice_eip_cmd, verify_cap_sys_nice_eip, }, vulkaninfo::VulkanInfo, wivrn_dbus, @@ -80,7 +79,6 @@ pub struct App { config: Config, xrservice_worker: Option, - autostart_worker: Option, plugins_worker: Option, restart_xrservice: bool, build_worker: Option, @@ -103,7 +101,6 @@ pub struct App { pub enum Msg { OnServiceLog(Vec), OnServiceExit(i32), - OnAutostartExit(i32), OnPluginsExit(i32), OnBuildLog(Vec), OnBuildExit(i32), @@ -246,40 +243,23 @@ impl App { pub fn run_autostart(&mut self, sender: AsyncComponentSender) { let prof = self.get_selected_profile(); - if let Some(autostart_cmd) = &prof.autostart_command { - let mut jobs = VecDeque::new(); - jobs.push_back(WorkerJob::new_cmd( - Some(prof.environment.clone()), - "sh".into(), - Some(vec!["-c".into(), autostart_cmd.clone()]), - )); - let autostart_worker = JobWorker::new(jobs, sender.input_sender(), |msg| match msg { - JobWorkerOut::Log(rows) => Msg::OnServiceLog(rows), - JobWorkerOut::Exit(code) => Msg::OnAutostartExit(code), - }); - autostart_worker.start(); - self.autostart_worker = Some(autostart_worker); - } - let plugins_cmd = self .config .plugins .values() .filter_map(|cp| { if cp.enabled && cp.plugin.validate() { - if let Some(exec) = cp.plugin.executable() { - if let Err(e) = mark_as_executable(&exec) { - error!( - "failed to mark plugin {} as executable: {e}", - cp.plugin.appid - ); - None - } else { - Some(format!("'{}'", exec.to_string_lossy())) - } - } else { - error!("no executable for plugin {}", cp.plugin.appid); + if let Err(e) = cp.plugin.mark_as_executable() { + error!( + "failed to mark plugin {} as executable: {e}", + cp.plugin.appid + ); None + } else { + Some(format!( + "'{}'", + cp.plugin.executable().unwrap().to_string_lossy() + )) } } else { None @@ -329,9 +309,6 @@ impl App { } pub fn shutdown_xrservice(&mut self) { - if let Some(w) = self.autostart_worker.as_ref() { - w.stop(); - } if let Some(w) = self.plugins_worker.as_ref() { w.stop(); } @@ -433,7 +410,6 @@ impl AsyncComponent for App { self.start_xrservice(sender, false); } } - Msg::OnAutostartExit(_) => self.autostart_worker = None, Msg::OnPluginsExit(_) => self.plugins_worker = None, Msg::ClockTicking => { self.main_view.sender().emit(MainViewMsg::ClockTicking); @@ -1039,7 +1015,6 @@ impl AsyncComponent for App { config, profiles, xrservice_worker: None, - autostart_worker: None, plugins_worker: None, build_worker: None, xr_devices: vec![], diff --git a/src/ui/plugins/mod.rs b/src/ui/plugins/mod.rs index 0a29bf2..11732df 100644 --- a/src/ui/plugins/mod.rs +++ b/src/ui/plugins/mod.rs @@ -50,7 +50,7 @@ impl Plugin { if let Some(p) = self.executable().as_ref() { mark_as_executable(p) } else { - bail!("no exec_path for plugin") + bail!("no executable found for plugin") } } diff --git a/src/ui/profile_editor.rs b/src/ui/profile_editor.rs index 353dff0..99f7b7b 100644 --- a/src/ui/profile_editor.rs +++ b/src/ui/profile_editor.rs @@ -130,14 +130,6 @@ impl SimpleComponent for ProfileEditor { prof.borrow_mut().prefix = n_path.unwrap_or_default().into(); }), ), - add: &entry_row("Autostart Command", - model.profile.borrow().autostart_command.as_ref().unwrap_or(&String::default()), - clone!(#[strong] prof, move |row| { - let txt = row.text().trim().to_string(); - prof.borrow_mut().autostart_command = - if txt.is_empty() {None} else {Some(txt)}; - }) - ), add: &switch_row("Dependency Check", Some("Warning: disabling dependency checks may result in build failures"), !model.profile.borrow().skip_dependency_check,