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

Add support for XDG base directory. #295

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

c4llv07e
Copy link

I have a non-standard config and cache location, and I would like Abaddon to follow the XDG standards and try to use these variables for default directories.

This does not affect normal users, because they either have these variables pointing to .config, .cache and .local/share or they simply don't have it.

Maybe I should refactor this copy-pasted code, but I am not sure if this will make it better.

@ouwou
Copy link
Member

ouwou commented Apr 23, 2024

the copy pasting definitely isnt the right move but i can go in and clean this up probably

@c4llv07e
Copy link
Author

the copy pasting definitely isnt the right move but i can go in and clean this up probably

Something like this?

@c4llv07e
Copy link
Author

I don't like the "" solution, but returning C strings is even worse. I can't find any std::string* in the project, so I assumed that there shouldn't be any allocations in the functions, and because of that I can't use nullptr either.

Try to use $XDG_CONFIG_HOME, $XDG_DATA_HOME and $XDG_CACHE_HOME on
Linux before using $HOME/.config.
@c4llv07e
Copy link
Author

Force pushed because of the rebase.

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.

2 participants