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 directories with backwards compatibility. Fixes #33. #69

Closed
wants to merge 2 commits into from

Conversation

pnelson
Copy link
Contributor

@pnelson pnelson commented Oct 25, 2013

To determine where the configuration files are located, the logic
is as follows:

  • CMUS_HOME takes priority, as before.
  • ~/.cmus is used if it already exists, to maintain backward
    compatibility.
  • New users default to XDG_CONFIG_HOME/cmus, or ~/.config/cmus if
    XDG_CONFIG_HOME is unset.

To determine where the socket is located is a bit more simple:

  • XDG_RUNTIME_DIR/cmus-socket if XDG_RUNTIME_DIR is set.
  • Otherwise, name it 'socket' in the config directory, as before.

To determine where the configuration files are located, the logic
is as follows:

- CMUS_HOME takes priority, as before.
- ~/.cmus is used if it already exists, to maintain backward
  compatibility.
- New users default to XDG_CONFIG_HOME/cmus, or ~/.config/cmus if
  XDG_CONFIG_HOME is unset.

To determine where the socket is located is a bit more simple:

- XDG_RUNTIME_DIR/cmus-socket if XDG_RUNTIME_DIR is set.
- Otherwise, name it 'socket' in the config directory, as before.
@pnelson
Copy link
Contributor Author

pnelson commented Oct 25, 2013

Adding to the discussion in #33, misc_init and 3 other methods are used for both cmus and cmus_remote. The other methods in misc.c are things like escaping strings, expanding filenames, string comparisons, etc.

@flyingmutant
Copy link
Member

Can you please update the cmus documentation as well?

@pnelson
Copy link
Contributor Author

pnelson commented Oct 30, 2013

I think that covers it all. I updated the documentation such that it reflects the new version, going forward.

@flyingmutant
Copy link
Member

Oh, I am very sorry for not replying for so long — for some reason I missed the Github notification that this was updated 4 days ago!

@@ -230,7 +231,7 @@ enum flags {
" or: %s\n"
"Control cmus through socket.\n"
"\n"
" --server ADDR connect using ADDR instead of ~/.cmus/socket\n"
" --server ADDR connect using ADDR instead of $XDG_RUNTIME_DIR/socket\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be $XDG_RUNTIME_DIR/cmus-socket, but I'll fix this myself.

@flyingmutant
Copy link
Member

Thank you a lot! Merged.

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

Successfully merging this pull request may close these issues.

None yet

2 participants