Skip to content

Add support for XDG base directory.#295

Open
c4llv07e wants to merge 1 commit intouowuo:masterfrom
c4llv07e:master
Open

Add support for XDG base directory.#295
c4llv07e wants to merge 1 commit intouowuo:masterfrom
c4llv07e:master

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