diff --git a/src/env_var_descriptions.rs b/src/env_var_descriptions.rs index 6611f07..4e6c557 100644 --- a/src/env_var_descriptions.rs +++ b/src/env_var_descriptions.rs @@ -12,7 +12,7 @@ pub static ENV_VAR_DESCRIPTIONS: Map<&str, &str> = phf_map! { "Colon-separated list of directories where the dynamic linker will search for shared object libraries.", "XRT_DEBUG_GUI" => "Set to 1 to enable the Monado debug UI", "XRT_JSON_LOG" => "Set to 1 to enable JSON logging for Monado. This enables better log visualization and log level filtering.", - "LH_DRIVER" => "Lighthouse driver; Valid options are: \"vive\" for the default built-in driver, \"survive\" for Libsurvive, \"steamvr\" for the SteamVR based implementation.", + "LH_DRIVER" => "Lighthouse driver, this overrides the \"Lighthouse driver option in the profile\"; Valid options are: \"vive\" for the default built-in driver, \"survive\" for Libsurvive, \"steamvr\" for the SteamVR based implementation.", "LH_LOG" => "Lighthouse log level. Can be one of: \"trace\", \"debug\", \"info\", \"warn\", \"error\".", "LIGHTHOUSE_LOG" => "Lighthouse driver log level. Can be one of: \"trace\", \"debug\", \"info\", \"warn\", \"error\"." }; diff --git a/src/profiles/lighthouse.rs b/src/profiles/lighthouse.rs new file mode 100644 index 0000000..466ef1e --- /dev/null +++ b/src/profiles/lighthouse.rs @@ -0,0 +1,33 @@ +use crate::{ + constants::APP_NAME, + paths::{data_monado_path, data_opencomposite_path, get_data_dir}, + profile::{LighthouseDriver, Profile, ProfileFeatures, XRServiceType}, +}; +use std::collections::HashMap; + +pub fn lighthouse_profile() -> Profile { + let data_dir = get_data_dir(); + let prefix = format!("{data}/prefixes/lighthouse_default", data = data_dir); + let mut environment: HashMap = HashMap::new(); + environment.insert("XRT_JSON_LOG".into(), "1".into()); + environment.insert("XRT_COMPOSITOR_SCALE_PERCENTAGE".into(), "140".into()); + environment.insert("XRT_COMPOSITOR_COMPUTE".into(), "1".into()); + environment.insert( + "LD_LIBRARY_PATH".into(), + format!("{pfx}/lib:{pfx}/lib64", pfx = prefix), + ); + Profile { + uuid: "lighthouse-default".into(), + name: format!("Lighthouse Driver - {name} Default", name = APP_NAME), + xrservice_path: data_monado_path(), + xrservice_type: XRServiceType::Monado, + opencomposite_path: data_opencomposite_path(), + features: ProfileFeatures::default(), + environment, + prefix, + can_be_built: true, + editable: false, + lighthouse_driver: LighthouseDriver::SteamVR, + ..Default::default() + } +} diff --git a/src/profiles/mod.rs b/src/profiles/mod.rs index ab8d197..f9550b0 100644 --- a/src/profiles/mod.rs +++ b/src/profiles/mod.rs @@ -1,3 +1,4 @@ pub mod valve_index; pub mod system_valve_index; pub mod wivrn; +pub mod lighthouse;