use freedesktop instead of gtk
This commit is contained in:
@@ -5,13 +5,15 @@ edition = "2024"
|
||||
|
||||
|
||||
[dependencies]
|
||||
serde = { workspace = true, features = ["rc"] }
|
||||
glam = { workspace = true }
|
||||
chrono = "0.4.42"
|
||||
idmap = { workspace = true, features = ["serde"] }
|
||||
idmap-derive = { workspace = true }
|
||||
wayvr-ipc = { path = "../wayvr-ipc", default-features = false }
|
||||
anyhow = { workspace = true }
|
||||
xdg = "3.0"
|
||||
log = { workspace = true }
|
||||
|
||||
freedesktop.workspace = true
|
||||
anyhow.workspace = true
|
||||
glam.workspace = true
|
||||
idmap = { workspace = true, features = ["serde"] }
|
||||
idmap-derive.workspace = true
|
||||
log.workspace = true
|
||||
serde = { workspace = true, features = ["rc"] }
|
||||
|
||||
chrono = "0.4.42"
|
||||
smol = "2.0.2"
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
use std::{path::PathBuf, sync::LazyLock};
|
||||
|
||||
const FALLBACK_CACHE_PATH: &str = "/tmp/wayvr_cache";
|
||||
use freedesktop::xdg_cache_home;
|
||||
|
||||
static CACHE_ROOT_PATH: LazyLock<PathBuf> = LazyLock::new(|| {
|
||||
if let Some(mut dir) = xdg::BaseDirectories::new().get_cache_home() {
|
||||
dir.push("wayvr");
|
||||
return dir;
|
||||
}
|
||||
|
||||
//Return fallback cache path
|
||||
log::error!("Err: Failed to find cache path, using {FALLBACK_CACHE_PATH}");
|
||||
PathBuf::from(FALLBACK_CACHE_PATH)
|
||||
// Panics if neither $XDG_CACHE_HOME nor $HOME is set
|
||||
let mut dir = xdg_cache_home();
|
||||
dir.push("wayvr");
|
||||
dir
|
||||
});
|
||||
|
||||
fn get_cache_root() -> PathBuf {
|
||||
|
||||
Reference in New Issue
Block a user