diff options
Diffstat (limited to 'libs/nak/src/paths.rs')
| -rw-r--r-- | libs/nak/src/paths.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/nak/src/paths.rs b/libs/nak/src/paths.rs new file mode 100644 index 0000000..4b212b9 --- /dev/null +++ b/libs/nak/src/paths.rs @@ -0,0 +1,12 @@ +//! Shared data directory for Fluorine Manager. +//! +//! All data lives under `~/.local/share/fluorine/` — accessible from both +//! native and Flatpak builds (the Flatpak has `--filesystem=home`). + +use std::path::PathBuf; + +/// Returns the Fluorine data directory (`~/.local/share/fluorine`). +pub fn data_dir() -> PathBuf { + let home = std::env::var("HOME").unwrap_or_else(|_| "/tmp".to_string()); + PathBuf::from(home).join(".local/share/fluorine") +} |
