Skip to content

respect XDG by default on posixlikes #8

@asottile

Description

@asottile

👋 I'm down a bit of a rabbit hole -- let me explain first where I'm coming from and then my quick proposal

I am building a docker image which intentionally does not provide a writable home directory -- but instead provides a bunch of writable $XDG_... directories. I've noticed that cpan uses this module to determine where to write its configuration on first startup but File::HomeDir->my_data is always returning the home directory

I can work around this by installing xdg-user-dirs manually, or providing a placeholder executable by the same name -- but I don't think that executable should be necessary at all since most modern posixlikes support the XDG "standard"

personally, I would like to see the FreeDeskptop implementation be the default on posixlikes but that might be too aggressive of a change -- perhaps a more middle ground would be to have the default Unix implementation respect the $XDG_* variables even if the xdg-user-dirs executable isn't present (since it's kind of rare to install this in a docker image, even if you want the functionality)

the directories from xdg-user-dirs are also easily derivable without running the xdg-user-dir subprocess -- since they're specified: https://wiki.archlinux.org/title/XDG_user_directories

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions