-
Notifications
You must be signed in to change notification settings - Fork 3
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 Specification #3
Comments
erikw
added a commit
to erikw/cd-bookmark
that referenced
this issue
Nov 4, 2021
Backwards compatible change that supports storing the bookmarks in $XDG_CONFIG_HOME/cd-bookmarks. * If the user as set the previously existing $CD_BOOKMARK_FILE, this is always overriding. * If the user has created the directory/file $XDG_CONFIG_HOME/cd-bookmarks/(bookmarks), use this * Else fall back to old default $HOME/.cdbookmark Fixes mollifier#3
erikw
added a commit
to erikw/cd-bookmark
that referenced
this issue
Nov 4, 2021
Backwards compatible change that supports storing the bookmarks in $XDG_CONFIG_HOME/cd-bookmarks. * If the user as set the previously existing $CD_BOOKMARK_FILE, this is always overriding. * If the user has created the directory/file $XDG_CONFIG_HOME/cd-bookmarks/(bookmarks), use this * Else fall back to old default $HOME/.cdbookmark Fixes mollifier#3
erikw
added a commit
to erikw/cd-bookmark
that referenced
this issue
Nov 4, 2021
Backwards compatible change that supports storing the bookmarks in $XDG_CONFIG_HOME/cd-bookmarks. * If the user as set the previously existing $CD_BOOKMARK_FILE, this is always overriding. * If the user has created the directory/file $XDG_CONFIG_HOME/cd-bookmarks/(bookmarks), use this * Else fall back to old default $HOME/.cdbookmark Fixes mollifier#3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First of all, thanks for this really great shell enhancer. I use it every day!
Background
Lately the XDG Base Directory Specification has been gaining quite a steady popularity, even though it's been around for a long time already. The basic idea is to standardize where programs put their files e.g. all config files in a certain directory. The benefits for end users are many, including:
$XDG_CONFIG_HOME
$XDG_STATE_HOME
or even$XDG_DATA_HOME
, but without destroying and configuration files.The first point is maybe what most end users enjoy the most though.
How
Specifically for this project, this should mean that the search for the configuration file should be done like:
$CD_BOOKMARK_FILE
is set, use this directly$XDG_CONFIG_HOME
is set, look for$XDG_CONFIG_HOME/cd-bookmark/bookmarks
$XDG_CONFIG_HOME
is unset, use the default value for the envvar which is$HOME/.config
. Thus, the config file to look for is at$HOME/.config/cd-bookmark/bookmarks
$HOME/.cdbookmark
The first two new steps to can be codifed in bash like:
${XDG_CONFIG_HOME:-$HOME/.config}/cd-bookmark/bookmarks
The text was updated successfully, but these errors were encountered: