Use decky-provided settings directory

This commit is contained in:
NGnius (Graham) 2023-11-18 15:31:45 -05:00
parent 3aa9680bae
commit 396a52da5e
2 changed files with 9 additions and 2 deletions

View file

@ -12,7 +12,7 @@ readme = "../README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
usdpl-back = { version = "0.10.1", features = ["blocking"] }#, path = "../../usdpl-rs/usdpl-back"}
usdpl-back = { version = "0.10.1", features = ["blocking", "decky"] }#, path = "../../usdpl-rs/usdpl-back"}
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
ron = "0.8"

View file

@ -22,12 +22,19 @@ pub fn ron_pretty_config() -> ron::ser::PrettyConfig {
.compact_arrays(true)
}
pub fn settings_dir() -> std::path::PathBuf {
#[allow(dead_code)]
pub fn settings_dir_old() -> std::path::PathBuf {
usdpl_back::api::dirs::home()
.unwrap_or_else(|| "/tmp/".into())
.join(".config/powertools/")
}
pub fn settings_dir() -> std::path::PathBuf {
usdpl_back::api::decky::settings_dir()
.unwrap_or_else(|_| "/tmp/".to_owned())
.into()
}
pub fn chown_settings_dir() -> std::io::Result<()> {
let dir = settings_dir();
#[cfg(feature = "decky")]