config_io: Support wayvr.conf.d directory, refactoring (#139)

This commit is contained in:
Aleksander
2025-01-20 15:26:17 +01:00
committed by GitHub
parent b209f79188
commit 3c792608e7
10 changed files with 86 additions and 54 deletions

View File

@@ -751,7 +751,7 @@ pub struct TokenConf {
#[cfg(feature = "pipewire")]
fn get_pw_token_path() -> PathBuf {
let mut path = config_io::get_conf_d_path();
let mut path = config_io::ConfigRoot::Generic.get_conf_d_path();
path.push("pw_tokens.yaml");
path
}

View File

@@ -244,6 +244,10 @@ where
{
let conf_dash = &app.session.wayvr_config.dashboard;
let Some(conf_dash) = &conf_dash else {
anyhow::bail!("Dashboard is not configured");
};
if !wayvr.dashboard_executed && !executable_exists_in_path(&conf_dash.exec) {
anyhow::bail!("Executable \"{}\" not found", &conf_dash.exec);
}
@@ -280,7 +284,9 @@ where
overlay.state.z_order = Z_ORDER_DASHBOARD;
overlay.state.reset(app, true);
let conf_dash = &app.session.wayvr_config.dashboard;
let Some(conf_dash) = &app.session.wayvr_config.dashboard else {
unreachable!(); /* safe, not possible to trigger */
};
// FIXME: overlay curvature needs to be dispatched for some unknown reason, this value is not set otherwise
app.tasks.enqueue(TaskType::Overlay(