diff --git a/src/dependencies/monado_deps.rs b/src/dependencies/monado_deps.rs index df3e124..b0e0ffd 100644 --- a/src/dependencies/monado_deps.rs +++ b/src/dependencies/monado_deps.rs @@ -40,6 +40,16 @@ fn monado_deps() -> Vec { ]), }, dep_glslang_validator(), + Dependency { + name: "sdl2".into(), + dep_type: DepType::SharedObject, + filename: "libSDL2.so".into(), + packages: HashMap::from([ + (LinuxDistro::Arch, "sdl2".into()), + (LinuxDistro::Debian, "libsdl2".into()), + (LinuxDistro::Fedora, "SDL2".into()), + ]), + }, ] } diff --git a/src/env_var_descriptions.rs b/src/env_var_descriptions.rs index e5b5f21..94213ae 100644 --- a/src/env_var_descriptions.rs +++ b/src/env_var_descriptions.rs @@ -14,6 +14,7 @@ pub static ENV_VAR_DESCRIPTIONS: Map<&str, &str> = phf_map! { "XRT_DEBUG_GUI" => "Set to 1 to enable the Monado debug UI.", "XRT_CURATED_GUI" => "Set to 1 to enable the Monado preview UI. Requires XRT_DEBUG_GUI=1 to work.", "XRT_JSON_LOG" => "Set to 1 to enable JSON logging for Monado. This enables better log visualization and log level filtering.", + "QWERTY_ENABLE" => "Set to 1 to enable QWERTY Simulation driver. This enables simulated driver that allows you to use Monado without HMD and controllers. It's also possible to mix and match different profiles with this.", "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/mod.rs b/src/profiles/mod.rs index 4266673..b942f04 100644 --- a/src/profiles/mod.rs +++ b/src/profiles/mod.rs @@ -1,5 +1,6 @@ pub mod lighthouse; pub mod openhmd; +pub mod simulated; pub mod survive; pub mod wivrn; pub mod wmr; diff --git a/src/profiles/simulated.rs b/src/profiles/simulated.rs new file mode 100644 index 0000000..d04d4c4 --- /dev/null +++ b/src/profiles/simulated.rs @@ -0,0 +1,36 @@ +use crate::{ + constants::APP_NAME, + paths::{data_monado_path, data_opencomposite_path, get_data_dir}, + profile::{Profile, ProfileFeatures, XRServiceType}, +}; +use std::collections::HashMap; + +pub fn simulated_profile() -> Profile { + let data_dir = get_data_dir(); + let prefix = format!("{data}/prefixes/simulated_default", data = data_dir); + let mut environment: HashMap = HashMap::new(); + environment.insert("QWERTY_ENABLE".into(), "1".into()); + 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("XRT_DEBUG_GUI".into(), "1".into()); + environment.insert("XRT_CURATED_GUI".into(), "1".into()); + environment.insert("U_PACING_APP_USE_MIN_FRAME_PERIOD".into(), "1".into()); + environment.insert( + "LD_LIBRARY_PATH".into(), + format!("{pfx}/lib:{pfx}/lib64", pfx = prefix), + ); + Profile { + uuid: "simulated-default".into(), + name: format!("Simulated 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, + ..Default::default() + } +} diff --git a/src/ui/app.rs b/src/ui/app.rs index 3daa827..f77967a 100644 --- a/src/ui/app.rs +++ b/src/ui/app.rs @@ -40,6 +40,7 @@ use crate::paths::{get_data_dir, get_ipc_file_path}; use crate::profile::{Profile, XRServiceType}; use crate::profiles::lighthouse::lighthouse_profile; use crate::profiles::openhmd::openhmd_profile; +use crate::profiles::simulated::simulated_profile; use crate::profiles::survive::survive_profile; use crate::profiles::wivrn::wivrn_profile; use crate::profiles::wmr::wmr_profile; @@ -256,6 +257,7 @@ impl App { wivrn_profile(), wmr_profile(), openhmd_profile(), + simulated_profile(), ]; profiles.extend(config.user_profiles.clone()); profiles.sort_unstable_by(|a, b| a.name.cmp(&b.name));