fix(config): use XDG picture directory as default
Replace hardcoded \"~/Pictures\" with dirs::picture_dir() which resolves to the actual absolute path (e.g. /home/user/Pictures). The tilde (~) in paths is not automatically expanded by Rust's PathBuf, causing path.exists() to return false for \"~/Pictures\". Using dirs::picture_dir() provides: - Proper absolute path resolution - XDG Base Directory compliance - Fallback to home directory if Pictures doesn't exist Note: Users with existing config files need to delete ~/.config/cosmic/org.codeberg.wfx.Noctua/v1/default_image_dir to apply the new default."
This commit is contained in:
parent
afdee6b430
commit
e71a97a2cb
4 changed files with 53 additions and 10 deletions
41
Cargo.lock
generated
41
Cargo.lock
generated
|
|
@ -1229,7 +1229,7 @@ dependencies = [
|
|||
"atomicwrites",
|
||||
"cosmic-config-derive",
|
||||
"cosmic-settings-daemon",
|
||||
"dirs",
|
||||
"dirs 6.0.0",
|
||||
"futures-util",
|
||||
"iced_futures",
|
||||
"known-folders",
|
||||
|
|
@ -1318,7 +1318,7 @@ dependencies = [
|
|||
"almost",
|
||||
"cosmic-config",
|
||||
"csscolorparser",
|
||||
"dirs",
|
||||
"dirs 6.0.0",
|
||||
"palette",
|
||||
"ron",
|
||||
"serde",
|
||||
|
|
@ -1518,13 +1518,34 @@ dependencies = [
|
|||
"crypto-common",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dirs"
|
||||
version = "5.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225"
|
||||
dependencies = [
|
||||
"dirs-sys 0.4.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dirs"
|
||||
version = "6.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e"
|
||||
dependencies = [
|
||||
"dirs-sys",
|
||||
"dirs-sys 0.5.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "dirs-sys"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"option-ext",
|
||||
"redox_users 0.4.6",
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1535,7 +1556,7 @@ checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab"
|
|||
dependencies = [
|
||||
"libc",
|
||||
"option-ext",
|
||||
"redox_users",
|
||||
"redox_users 0.5.2",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
|
|
@ -3610,6 +3631,7 @@ version = "0.1.0"
|
|||
dependencies = [
|
||||
"anyhow",
|
||||
"clap",
|
||||
"dirs 5.0.1",
|
||||
"env_logger",
|
||||
"futures-util",
|
||||
"i18n-embed",
|
||||
|
|
@ -4793,6 +4815,17 @@ dependencies = [
|
|||
"bitflags 2.10.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_users"
|
||||
version = "0.4.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43"
|
||||
dependencies = [
|
||||
"getrandom 0.2.16",
|
||||
"libredox",
|
||||
"thiserror 1.0.69",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "redox_users"
|
||||
version = "0.5.2"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue