Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support XDG base directory #96

Open
poperigby opened this issue May 7, 2021 · 0 comments
Open

Support XDG base directory #96

poperigby opened this issue May 7, 2021 · 0 comments

Comments

@poperigby
Copy link

Hey. It would be cool if FDM searched $XDG_CONFIG_HOME for fdm.conf, which is part of the XDG base directory specification.

mikejzx added a commit to mikejzx/fdm that referenced this issue Dec 1, 2023
Implements nicm#96

https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

If no configuration file is specified on the command-line,
$XDG_CONFIG_HOME/fdm.conf is now the first file checked, then
$HOME/.fdm.conf, and finally the system-wide /etc/fdm.conf.

This allows the user to specify where they would like the configuration
file to be stored.  E.g. many users like to set XDG_CONFIG_HOME to
$HOME/.config so that all their XDG-compliant programs have their
configuration files stored there rather than in their home directory (or
other arbitrary locations).
mikejzx added a commit to mikejzx/fdm that referenced this issue Dec 1, 2023
Continuation of nicm#96 implementation.

From https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html:

> There is a single base directory relative to which user-specific
> runtime files and other file objects should be placed.  This directory
> is defined by the environment variable $XDG_RUNTIME_DIR.

This also may provide slight performance benefits to this as
XDG_RUNTIME_DIR is often set to a directory under /tmp which some
systems configure to be mounted as tmpfs.

If XDG_RUNTIME_DIR is not set or is an empty string, the old behaviour
of the user's home directory is used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant