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 the home directory location (linux only) #791

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ void FS_ShutDown( void ) {

void FS_InitFilesystemEx( qbool guess_cwd ) {
int i;
char tmp_path[MAX_OSPATH];
char tmp_path[MAX_OSPATH], *xdg;

FS_ShutDown();

Expand Down Expand Up @@ -761,7 +761,13 @@ void FS_InitFilesystemEx( qbool guess_cwd ) {
#ifdef _WIN32
strlcat(com_homedir, "/ezQuake", sizeof(com_homedir));
#else
strlcat(com_homedir, "/.ezquake", sizeof(com_homedir));
xdg = getenv("XDG_DATA_HOME");
if(xdg) {
strlcpy(com_homedir, xdg, sizeof(com_homedir));
strlcat(com_homedir, "/ezquake", sizeof(com_homedir));
} else {
strlcat(com_homedir, "/.local/share/ezquake", sizeof(com_homedir));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think many won't like this change. Why the '.local/share' prefix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if XDG_DATA_HOME isn't set, it should default to ~/.local/share

Copy link
Collaborator

@tcsabina tcsabina Jul 3, 2023

Choose a reason for hiding this comment

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

if XDG_DATA_HOME isn't set, it should default to ~/.local/share

I know ;).
But that is exactly why I commented...

Why do you think we need to move the ezquake home directory to '~/.local/share/ezquake'?
What makes you think that this is better, compared to the current one?
Is this your personal taste? Or some kind of "standard" of some linux distro? If yes, which distro? What about other distro's "standard".

You see my point?

Also, as I have indicated, there is another PR open which is tackling these directories under linux. That PR seems to cover much more on top of the "home directory". So I rather wait on that PR to be finalized, instead of just merging this PR that only touches to home directory of ezquake.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why do you think we need to move the ezquake home directory to '~/.local/share/ezquake'?
What makes you think that this is better, compared to the current one?

it follows the XDG spec more closely :P

I rather wait on that PR to be finalized

then have fun waiting, personally i think we will not hear from the author of that pr anytime soon

sorry for the late reply and i guess this pr can be closed then

}
#endif
Com_Printf("Using home directory \"%s\"\n", com_homedir);
}
Expand Down Expand Up @@ -818,7 +824,7 @@ void FS_InitFilesystem( void ) {

FS_InitModuleFS();
FS_InitFilesystemEx( false ); // first attempt, simplified
vfs = FS_OpenVFS("gfx.wad", "rb", FS_ANY);
vfs = FS_OpenVFS("gfx.wad", "rb", FS_ANY);
if (vfs) { // // we found gfx.wad, seems we have proper com_basedir
VFS_CLOSE(vfs);
return;
Expand Down