mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-02 14:18:49 +00:00
feat: show warning for wivrn profiles inside appimage
This commit is contained in:
parent
193505a067
commit
7e2a585b0f
3 changed files with 28 additions and 0 deletions
11
src/is_appimage.rs
Normal file
11
src/is_appimage.rs
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
use std::env;
|
||||||
|
|
||||||
|
use lazy_static::lazy_static;
|
||||||
|
|
||||||
|
fn is_appimage() -> bool {
|
||||||
|
env::var("APPIMAGE").is_ok_and(|s| !s.trim().is_empty())
|
||||||
|
}
|
||||||
|
|
||||||
|
lazy_static! {
|
||||||
|
pub static ref IS_APPIMAGE: bool = is_appimage();
|
||||||
|
}
|
|
@ -29,6 +29,7 @@ pub mod file_builders;
|
||||||
pub mod file_utils;
|
pub mod file_utils;
|
||||||
pub mod func_runner;
|
pub mod func_runner;
|
||||||
pub mod gpu_profile;
|
pub mod gpu_profile;
|
||||||
|
pub mod is_appimage;
|
||||||
pub mod linux_distro;
|
pub mod linux_distro;
|
||||||
pub mod log_level;
|
pub mod log_level;
|
||||||
pub mod log_parser;
|
pub mod log_parser;
|
||||||
|
|
|
@ -33,6 +33,7 @@ use crate::file_builders::openvrpaths_vrpath::{
|
||||||
set_current_openvrpaths_to_profile, set_current_openvrpaths_to_steam,
|
set_current_openvrpaths_to_profile, set_current_openvrpaths_to_steam,
|
||||||
};
|
};
|
||||||
use crate::file_utils::setcap_cap_sys_nice_eip;
|
use crate::file_utils::setcap_cap_sys_nice_eip;
|
||||||
|
use crate::is_appimage::IS_APPIMAGE;
|
||||||
use crate::linux_distro::LinuxDistro;
|
use crate::linux_distro::LinuxDistro;
|
||||||
use crate::paths::{get_data_dir, get_ipc_file_path};
|
use crate::paths::{get_data_dir, get_ipc_file_path};
|
||||||
use crate::profile::{Profile, XRServiceType};
|
use crate::profile::{Profile, XRServiceType};
|
||||||
|
@ -105,6 +106,9 @@ pub struct App {
|
||||||
|
|
||||||
#[tracker::do_not_track]
|
#[tracker::do_not_track]
|
||||||
skip_depcheck: bool,
|
skip_depcheck: bool,
|
||||||
|
|
||||||
|
#[tracker::do_not_track]
|
||||||
|
wivrn_appimage_warn_shown: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
@ -647,6 +651,17 @@ impl SimpleComponent for App {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Msg::ProfileSelected(prof) => {
|
Msg::ProfileSelected(prof) => {
|
||||||
|
if *IS_APPIMAGE
|
||||||
|
&& !self.wivrn_appimage_warn_shown
|
||||||
|
&& prof.xrservice_type == XRServiceType::Wivrn
|
||||||
|
{
|
||||||
|
alert(
|
||||||
|
"Envision is running as an AppImage",
|
||||||
|
Some("WiVRn does not support running inside an AppImage, and is likely to fail. You might want to install Envision using a different method."),
|
||||||
|
Some(&self.app_win.clone().upcast()),
|
||||||
|
);
|
||||||
|
self.wivrn_appimage_warn_shown = true;
|
||||||
|
}
|
||||||
if prof.uuid == self.config.selected_profile_uuid {
|
if prof.uuid == self.config.selected_profile_uuid {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -803,6 +818,7 @@ impl SimpleComponent for App {
|
||||||
libmonado: None,
|
libmonado: None,
|
||||||
wivrn_conf_editor: None,
|
wivrn_conf_editor: None,
|
||||||
skip_depcheck: false,
|
skip_depcheck: false,
|
||||||
|
wivrn_appimage_warn_shown: false,
|
||||||
};
|
};
|
||||||
let widgets = view_output!();
|
let widgets = view_output!();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue