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

Move wavemonrc to XDG_CONFIG_HOME #106

Closed
grrtrr opened this issue Sep 18, 2021 · 1 comment · Fixed by #105
Closed

Move wavemonrc to XDG_CONFIG_HOME #106

grrtrr opened this issue Sep 18, 2021 · 1 comment · Fixed by #105
Assignees

Comments

@grrtrr
Copy link
Contributor

grrtrr commented Sep 18, 2021

Support for this was started in #105, but is not uniform yet.

The following needs to be resolved:

  • support for the XDG base directory specification,
  • gracefully handle existing ~/.wavemonrc (e.g. by unlinking or moving it),
  • update documentation,
  • make naming consistent.
@grrtrr
Copy link
Contributor Author

grrtrr commented Sep 18, 2021

Implementation Plan

1. When writing the configuration file

Writing is easier, since it can use the new location right away.

  1. Determine BASE:
    • if XDG_CONFIG_HOME is set, use this value as BASE,
    • else, set BASE = ~/.config (as per specification);
  2. If the BASE directory does not exist, create it.
  3. If the BASE/wavemon directory does not exist, create it.
  4. Use BASE/wavemon/wavemonrc for the location of the wavemon runtime-configuration file.

2. When reading the configuration file

  1. If ~/.wavemonrc exists, read it, but unlink(2) it afterwards.
  2. Else use BASE/wavemon/wavemonrc as above.

3. Notes

  • The name/path was chosen for compatibility with the existing wavemonrc(5) man-page.
  • Man-page(s) and documentation need to be updated accordingly.

@grrtrr grrtrr self-assigned this Sep 18, 2021
@grrtrr grrtrr linked a pull request Sep 18, 2021 that will close this issue
@grrtrr grrtrr closed this as completed in 6ac534c Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant