diff --git a/meson.build b/meson.build index f9f34a6..36ec669 100644 --- a/meson.build +++ b/meson.build @@ -61,6 +61,7 @@ meson.add_dist_script( global_conf = configuration_data() global_conf.set('APP_ID', application_id) +global_conf.set('RESOURCES_BASE_PATH', '/' + base_id.replace('.', '/')) global_conf.set('PKGDATADIR', pkgdatadir) global_conf.set('PROFILE', profile) global_conf.set('VERSION', version + version_suffix) diff --git a/src/constants.rs.in b/src/constants.rs.in index 79639a5..a77737c 100644 --- a/src/constants.rs.in +++ b/src/constants.rs.in @@ -2,6 +2,7 @@ use crate::paths::get_exec_prefix; pub const APP_NAME: &str = "@PRETTY_NAME@"; pub const APP_ID: &str = "@APP_ID@"; +pub const RESOURCES_BASE_PATH: &str = "@RESOURCES_BASE_PATH@"; pub const PKG_DATA_DIR: &str = "@PKGDATADIR@"; pub const RESOURCES: &str = concat!("@PKGDATADIR@", "/resources.gresource"); pub const CMD_NAME: &str = "@CMD_NAME@"; diff --git a/src/downloader.rs b/src/downloader.rs index bc78be6..5e1d3f8 100644 --- a/src/downloader.rs +++ b/src/downloader.rs @@ -1,4 +1,4 @@ -use crate::file_utils::get_writer; +use crate::{constants::APP_ID, file_utils::get_writer}; use reqwest::{ header::{HeaderMap, USER_AGENT}, Method, @@ -11,7 +11,7 @@ const CHUNK_SIZE: usize = 1024; fn headers() -> HeaderMap { let mut headers = HeaderMap::new(); - headers.insert(USER_AGENT, "org.gabmus.envision/1.0".parse().unwrap()); + headers.insert(USER_AGENT, format!("{}/1.0", APP_ID).parse().unwrap()); headers } diff --git a/src/main.rs b/src/main.rs index 5ac7bc1..d102edc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,13 +1,10 @@ -use std::env; - use anyhow::Result; -use constants::{resources, APP_ID, APP_NAME, GETTEXT_PACKAGE, LOCALE_DIR}; +use constants::{resources, APP_ID, APP_NAME, GETTEXT_PACKAGE, LOCALE_DIR, RESOURCES_BASE_PATH}; use file_builders::{ active_runtime_json::{get_current_active_runtime, set_current_active_runtime_to_steam}, openvrpaths_vrpath::{get_current_openvrpaths, set_current_openvrpaths_to_steam}, }; use gettextrs::LocaleCategory; -use gtk::prelude::ObjectExt; use relm4::{ adw, gtk::{self, gdk, gio, glib}, @@ -82,7 +79,7 @@ fn main() -> Result<()> { } let provider = gtk::CssProvider::new(); - provider.load_from_resource("/org/gabmus/envision/style.css"); + provider.load_from_resource(&format!("{}/style.css", RESOURCES_BASE_PATH)); if let Some(display) = gdk::Display::default() { gtk::style_context_add_provider_for_display( &display, diff --git a/src/ui/debug_view.rs b/src/ui/debug_view.rs index 4eb7657..d695a82 100644 --- a/src/ui/debug_view.rs +++ b/src/ui/debug_view.rs @@ -61,7 +61,7 @@ impl SimpleComponent for DebugView { menu! { debug_menu: { section! { - "Open Envision _Data Folder" => DebugOpenDataAction, + "Open _Data Folder" => DebugOpenDataAction, "Open _Prefix Folder" => DebugOpenPrefixAction, }, } diff --git a/src/ui/main_view.rs b/src/ui/main_view.rs index 2e1dbdb..de61d76 100644 --- a/src/ui/main_view.rs +++ b/src/ui/main_view.rs @@ -223,7 +223,7 @@ impl SimpleComponent for MainView { set_label: concat!( "Your current prefix is inside a partition ", "mounted with the nosuid option. This will prevent ", - "the Envision runtime from acquiring certain privileges ", + "the XR runtime from acquiring certain privileges ", "and will cause noticeable stutter when running XR ", "applications." ),