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")
}
#[derive(Deserialize, Serialize)]
#[derive(Clone, Deserialize, Serialize)]
pub struct WayVRDashboard {
pub exec: String,
pub args: Option<String>,

View File

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