Use decky-provided settings directory
This commit is contained in:
parent
3aa9680bae
commit
396a52da5e
2 changed files with 9 additions and 2 deletions
|
@ -12,7 +12,7 @@ readme = "../README.md"
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[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 = { version = "1.0", features = ["derive"] }
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
ron = "0.8"
|
ron = "0.8"
|
||||||
|
|
|
@ -22,12 +22,19 @@ pub fn ron_pretty_config() -> ron::ser::PrettyConfig {
|
||||||
.compact_arrays(true)
|
.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()
|
usdpl_back::api::dirs::home()
|
||||||
.unwrap_or_else(|| "/tmp/".into())
|
.unwrap_or_else(|| "/tmp/".into())
|
||||||
.join(".config/powertools/")
|
.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<()> {
|
pub fn chown_settings_dir() -> std::io::Result<()> {
|
||||||
let dir = settings_dir();
|
let dir = settings_dir();
|
||||||
#[cfg(feature = "decky")]
|
#[cfg(feature = "decky")]
|
||||||
|
|
Loading…
Reference in a new issue