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

XDG directories #33

Closed
ghost opened this issue Apr 13, 2013 · 8 comments
Closed

XDG directories #33

ghost opened this issue Apr 13, 2013 · 8 comments

Comments

@ghost
Copy link

ghost commented Apr 13, 2013

It would be absolutely sick if cmus supported XDG directories under Linux. As for migration worries, per-distribution package maintainers can sort them out.

@flyingmutant
Copy link
Member

Can you please explain a bit what exact feature do you want, and what for?

@ghost
Copy link
Author

ghost commented Apr 16, 2013

Default to XDG directories. People don't like yet another folder spammed to their home folder and expect programs to follow the damn standards as they make for a more predictable OS. It's part of the cmus modernisation.

@pnelson
Copy link
Contributor

pnelson commented Oct 21, 2013

I can deal with $XDG_CONFIG_DIR and maintain backward compatibility.

What is a sane default for $XDG_RUNTIME_DIR? Also, I'm not quite sure how to implement one part of the spec: It MUST be created when the user first logs in and if the user fully logs out the directory MUST be removed.

Any suggestions?

@flyingmutant
Copy link
Member

I think this refers to some session manager (systemd, gnome-session etc.) magic. This is definitely not the task of regular applications.

@pnelson
Copy link
Contributor

pnelson commented Oct 21, 2013

Excellent. I'll work on this when I get some time.

@ghost
Copy link
Author

ghost commented Oct 21, 2013

There's a nice and simple implementation here if you want a reference:

http://projects.haxx.es/p/genetic-invasion/source/tree/master/src/game/Utilities.cc#L137

pnelson added a commit to pnelson/cmus that referenced this issue Oct 23, 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.
@pnelson
Copy link
Contributor

pnelson commented Oct 25, 2013

The only thing I was really questioning was if it was okay or not to add misc and xstrjoin to cmus-remote. Doing so allowed me to remove duplicate code in figuring out the socket path.

@flyingmutant
Copy link
Member

Adding a couple of object files is not a problem, of course. However, maybe it makes sense to split misc_init(), or do both cmus and cmus-remote need everything it does?

BTW, if we are already discussing code, maybe it is time for a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants