mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-13 11:38:53 +00:00
feat: wivrn profile
This commit is contained in:
parent
75e4ffb3b4
commit
4ba25392bb
5 changed files with 47 additions and 9 deletions
|
@ -3,3 +3,4 @@ install_data('build_basalt.sh', install_dir: pkgdatadir / 'scripts')
|
|||
install_data('build_libsurvive.sh', install_dir: pkgdatadir / 'scripts')
|
||||
install_data('build_monado.sh', install_dir: pkgdatadir / 'scripts')
|
||||
install_data('build_opencomposite.sh', install_dir: pkgdatadir / 'scripts')
|
||||
install_data('build_wivrn.sh', install_dir: pkgdatadir / 'scripts')
|
||||
|
|
|
@ -8,6 +8,10 @@ pub fn data_monado_path() -> String {
|
|||
format!("{data}/monado", data = get_data_dir())
|
||||
}
|
||||
|
||||
pub fn data_wivrn_path() -> String {
|
||||
format!("{data}/wivrn", data = get_data_dir())
|
||||
}
|
||||
|
||||
pub fn data_libsurvive_path() -> String {
|
||||
format!("{data}/libsurvive", data = get_data_dir())
|
||||
}
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
pub mod valve_index;
|
||||
pub mod system_valve_index;
|
||||
pub mod wivrn;
|
||||
|
|
25
src/profiles/wivrn.rs
Normal file
25
src/profiles/wivrn.rs
Normal file
|
@ -0,0 +1,25 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use crate::{file_utils::get_data_dir, profile::{Profile, XRServiceType}, paths::{data_wivrn_path, data_opencomposite_path}, constants::APP_NAME};
|
||||
|
||||
pub fn wivrn_profile() -> Profile {
|
||||
let data_dir = get_data_dir();
|
||||
let prefix = format!("{data}/prefixes/wivrn_default", data = data_dir);
|
||||
let mut environment: HashMap<String, String> = HashMap::new();
|
||||
environment.insert("LD_LIBRARY_PATH".into(), format!("{pfx}/lib", pfx = prefix));
|
||||
Profile {
|
||||
name: format!("WiVRn - {name} Default", name = APP_NAME),
|
||||
xrservice_path: data_wivrn_path(),
|
||||
xrservice_type: XRServiceType::Wivrn,
|
||||
opencomposite_path: data_opencomposite_path(),
|
||||
libsurvive_path: None,
|
||||
basalt_path: None,
|
||||
mercury_path: None,
|
||||
libsurvive_enabled: false,
|
||||
basalt_enabled: false,
|
||||
mercury_enabled: false,
|
||||
environment,
|
||||
prefix,
|
||||
can_be_built: true,
|
||||
}
|
||||
}
|
|
@ -24,6 +24,7 @@ use crate::file_utils::setcap_cap_sys_nice_eip;
|
|||
use crate::profile::{Profile, XRServiceType};
|
||||
use crate::profiles::system_valve_index::system_valve_index_profile;
|
||||
use crate::profiles::valve_index::valve_index_profile;
|
||||
use crate::profiles::wivrn::wivrn_profile;
|
||||
use crate::runner::{Runner, RunnerStatus};
|
||||
use crate::runner_pipeline::RunnerPipeline;
|
||||
use crate::ui::build_window::BuildWindowMsg;
|
||||
|
@ -275,12 +276,10 @@ impl SimpleComponent for App {
|
|||
// missing_deps.extend(get_missing_mercury_deps());
|
||||
// runners.push(get_build_mercury_runner(profile.clone()));
|
||||
// }
|
||||
runners.push(
|
||||
match profile.xrservice_type {
|
||||
runners.push(match profile.xrservice_type {
|
||||
XRServiceType::Monado => get_build_monado_runner(profile.clone()),
|
||||
XRServiceType::Wivrn => get_build_wivrn_runner(profile.clone()),
|
||||
}
|
||||
);
|
||||
});
|
||||
// no listed deps for opencomp
|
||||
}
|
||||
runners.push(get_build_opencomposite_runner(profile.clone()));
|
||||
|
@ -318,8 +317,12 @@ impl SimpleComponent for App {
|
|||
Msg::RunSetCap => {
|
||||
let profile = self.get_selected_profile();
|
||||
setcap_cap_sys_nice_eip(match profile.xrservice_type {
|
||||
XRServiceType::Monado => format!("{pfx}/bin/monado-service", pfx = profile.prefix),
|
||||
XRServiceType::Wivrn => format!("{pfx}/bin/wivrn-service", pfx = profile.prefix),
|
||||
XRServiceType::Monado => {
|
||||
format!("{pfx}/bin/monado-service", pfx = profile.prefix)
|
||||
}
|
||||
XRServiceType::Wivrn => {
|
||||
format!("{pfx}/bin/wivrn-service", pfx = profile.prefix)
|
||||
}
|
||||
});
|
||||
}
|
||||
Msg::ProfileSelected(prof_name) => {
|
||||
|
@ -356,7 +359,11 @@ impl SimpleComponent for App {
|
|||
sender: ComponentSender<Self>,
|
||||
) -> ComponentParts<Self> {
|
||||
let config = get_config();
|
||||
let profiles = vec![valve_index_profile(), system_valve_index_profile()];
|
||||
let profiles = vec![
|
||||
valve_index_profile(),
|
||||
system_valve_index_profile(),
|
||||
wivrn_profile(),
|
||||
];
|
||||
let dependencies_dialog = adw::MessageDialog::builder()
|
||||
.modal(true)
|
||||
.transient_for(root)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue