Fall back to HOME/Desktop instead of HOME if XDG_DESKTOP_DIR not found
This commit is contained in:
parent
d3f91e6457
commit
4e8ae6ad20
1 changed files with 5 additions and 1 deletions
|
|
@ -49,7 +49,11 @@ pub fn desktop() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let locations = vec![
|
let locations = vec![
|
||||||
match dirs::desktop_dir() {
|
match dirs::desktop_dir() {
|
||||||
Some(path) => Location::Path(path),
|
Some(path) => Location::Path(path),
|
||||||
None => Location::Path(home_dir()),
|
None => {
|
||||||
|
let path = home_dir().join("Desktop");
|
||||||
|
log::warn!("failed to find XDG_DESKTOP_DIR, falling back to {path:?}");
|
||||||
|
Location::Path(path)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue