mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-09-26 19:28:38 +00:00
feat: bwrap path for system profiles for XR_RUNTIME_JSON
This commit is contained in:
parent
1b405bc06b
commit
cc157862fb
3 changed files with 12 additions and 4 deletions
|
@ -11,3 +11,8 @@ pub fn data_monado_path() -> String {
|
|||
pub fn data_libsurvive_path() -> String {
|
||||
format!("{data}/libsurvive", data = get_data_dir())
|
||||
}
|
||||
|
||||
pub const SYSTEM_PREFIX: &str = "/usr";
|
||||
|
||||
/** System prefix inside a bubblewrap environment (flatpak or pressure vessel) */
|
||||
pub const BWRAP_SYSTEM_PREFIX: &str = "/run/host/usr";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use crate::file_utils::get_writer;
|
||||
use crate::{file_utils::get_writer, paths::{SYSTEM_PREFIX, BWRAP_SYSTEM_PREFIX}};
|
||||
use expect_dialog::ExpectDialog;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{collections::HashMap, fmt::Display, fs::File, io::BufReader};
|
||||
|
@ -31,7 +31,10 @@ impl Profile {
|
|||
let mut opts = vec![];
|
||||
opts.push(format!(
|
||||
"XR_RUNTIME_JSON={prefix}/share/openxr/1/openxr_monado.json",
|
||||
prefix = self.prefix
|
||||
prefix = match self.prefix.as_str() {
|
||||
SYSTEM_PREFIX => BWRAP_SYSTEM_PREFIX,
|
||||
other => other,
|
||||
}
|
||||
));
|
||||
opts.push(format!(
|
||||
"PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/monado_comp_ipc"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{constants::APP_NAME, paths::data_opencomposite_path, profile::Profile};
|
||||
use crate::{constants::APP_NAME, paths::{data_opencomposite_path, SYSTEM_PREFIX}, profile::Profile};
|
||||
use std::collections::HashMap;
|
||||
|
||||
pub fn system_valve_index_profile() -> Profile {
|
||||
|
@ -18,7 +18,7 @@ pub fn system_valve_index_profile() -> Profile {
|
|||
mercury_enabled: false,
|
||||
basalt_enabled: false,
|
||||
environment,
|
||||
prefix: "/usr".into(),
|
||||
prefix: SYSTEM_PREFIX.into(),
|
||||
can_be_built: false,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue