feature/prod-ready #1

Merged
GKaszewski merged 12 commits from feature/prod-ready into master 2026-03-15 19:03:32 +00:00
2 changed files with 9 additions and 5 deletions
Showing only changes of commit b68aef83ba - Show all commits

View File

@@ -13,6 +13,7 @@ k-launcher-kernel = { path = "../../k-launcher-kernel" }
serde = { workspace = true } serde = { workspace = true }
serde_json = "1.0" serde_json = "1.0"
tokio = { workspace = true } tokio = { workspace = true }
tracing = { workspace = true }
[target.'cfg(target_os = "linux")'.dependencies] [target.'cfg(target_os = "linux")'.dependencies]
xdg = "3" xdg = "3"

View File

@@ -36,11 +36,14 @@ impl FrecencyStore {
} }
pub fn load() -> Arc<Self> { pub fn load() -> Arc<Self> {
let path = xdg::BaseDirectories::new() let Some(data_home) = xdg::BaseDirectories::new().get_data_home() else {
.get_data_home() tracing::warn!("XDG_DATA_HOME unavailable; frecency disabled (in-memory only)");
.unwrap_or_else(|| PathBuf::from(".")) return Arc::new(Self {
.join("k-launcher") path: PathBuf::from("/dev/null"),
.join("frecency.json"); data: Mutex::new(HashMap::new()),
});
};
let path = data_home.join("k-launcher").join("frecency.json");
Self::new(path) Self::new(path)
} }