WayVR: Use wayvr-dashboard as the default executable if it's not set

This commit is contained in:
Aleksander
2025-05-06 16:06:12 +02:00
parent f6f330cedd
commit de56c99e36
2 changed files with 9 additions and 6 deletions

View File

@@ -117,7 +117,7 @@ fn def_blit_method() -> String {
String::from("dmabuf") String::from("dmabuf")
} }
#[derive(Deserialize, Serialize)] #[derive(Clone, Deserialize, Serialize)]
pub struct WayVRDashboard { pub struct WayVRDashboard {
pub exec: String, pub exec: String,
pub args: Option<String>, pub args: Option<String>,

View File

@@ -270,11 +270,14 @@ fn toggle_dashboard<O>(
where where
O: Default, O: Default,
{ {
let conf_dash = &app.session.wayvr_config.dashboard; let conf_dash = app.session.wayvr_config.dashboard.clone().map_or_else(
|| config_wayvr::WayVRDashboard {
let Some(conf_dash) = &conf_dash else { exec: String::from("wayvr-dashboard"),
anyhow::bail!("Dashboard is not configured"); args: None,
}; env: None,
},
|conf| conf,
);
if !wayvr.dashboard_executed && !executable_exists_in_path(&conf_dash.exec) { if !wayvr.dashboard_executed && !executable_exists_in_path(&conf_dash.exec) {
anyhow::bail!("Executable \"{}\" not found", &conf_dash.exec); anyhow::bail!("Executable \"{}\" not found", &conf_dash.exec);