Skip to content

Screenshot dir is not complying with xdg-userdir #296

@snaggen

Description

@snaggen

When I saw that screenshots would be stored in $XDG_SCREENSHOTS_DIR I added it to ~/.config/user-dirs.dirs
and verified that it worked by doing
xdg-user-dir SCREENSHOTS. However, it seems that that didn't work at all, it was still stored in ~/$XDG_PICTURES_DIR/Screenshots

and looking at the code

                std::env::var_os("XDG_SCREENSHOTS_DIR")
                    .map(PathBuf::from)
                    .filter(|p| p.is_absolute())
                    .or_else(|| {
                        // Fall back to XDG_PICTURES_DIR/Screenshots or ~/Pictures/Screenshots
                        dirs::picture_dir()
                            .or_else(|| dirs::home_dir().map(|h| h.join("Pictures")))
                            .map(|p| p.join("Screenshots"))
                    })

it currently only looks at the env. Which is quite weird, since the fallback actually handles XDG_PICTURES_DIR correct and then just attaches "Screenshots" to it.

I guess that the dirs crate needs to be patched to support XDG_SCREENSHOT_DIR and use that if set.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions