[PATCH 0/1] MR10543: Change default dir to ~/.local/share/wine
I switched it to `~/.local/share/wine` to fit XDG. I will edit all the docs and what not if `~/.local/share/wine` is see fit by maintainers. Soo please let me know if it's fit or not {width=900 height=234} Related issue: https://bugs.winehq.org/show_bug.cgi?id=48955 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10543
From: Twig6943 <119701717+Twig6943@users.noreply.github.com> --- dlls/mountmgr.sys/unixlib.c | 2 +- dlls/ntdll/unix/loader.c | 2 +- server/request.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/mountmgr.sys/unixlib.c b/dlls/mountmgr.sys/unixlib.c index 2a5fd272db6..f84027f36ef 100644 --- a/dlls/mountmgr.sys/unixlib.c +++ b/dlls/mountmgr.sys/unixlib.c @@ -99,7 +99,7 @@ static char *get_dosdevices_path( const char *dev ) if (prefix) asprintf( &path, "%s/dosdevices/%s", prefix, dev ); else - asprintf( &path, "%s/.wine/dosdevices/%s", getenv( "HOME" ), dev ); + asprintf( &path, "%s/.local/share/wine/dosdevices/%s", getenv( "HOME" ), dev ); return path; } diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c index b66be2bb06e..914eb9a0116 100644 --- a/dlls/ntdll/unix/loader.c +++ b/dlls/ntdll/unix/loader.c @@ -378,7 +378,7 @@ static void set_config_dir(void) { if (!home_dir) fatal_error( "could not determine your home directory\n" ); if (home_dir[0] != '/') fatal_error( "the home directory %s is not an absolute path\n", home_dir ); - config_dir = build_path( home_dir, ".wine" ); + config_dir = build_path( home_dir, ".local/share/wine" ); } } diff --git a/server/request.c b/server/request.c index 994169a0565..18031abcaa1 100644 --- a/server/request.c +++ b/server/request.c @@ -619,10 +619,10 @@ static char *create_server_dir( int force ) } if (!home) fatal_error( "could not determine your home directory\n" ); if (home[0] != '/') fatal_error( "your home directory %s is not an absolute path\n", home ); - if (!(config_dir = malloc( strlen(home) + sizeof("/.wine") ))) fatal_error( "out of memory\n" ); + if (!(config_dir = malloc( strlen(home) + sizeof("/.local/share/wine") ))) fatal_error( "out of memory\n" ); strcpy( config_dir, home ); for (p = config_dir + strlen(config_dir); p > config_dir; p--) if (p[-1] != '/') break; - strcpy( p, "/.wine" ); + strcpy( p, "/.local/share/wine" ); } if (chdir( config_dir ) == -1) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10543
Hi, Will this work while `$HOME/.local/` doesn't exist? Also, should we query the location through `$XDG_DATA_HOME` instead of hard-coding it? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10543#note_134776
Will this work while `$HOME/.local/` doesn't exist? Eeeh probably not. That being said a system that doesn't have that dir gonna have a lot of issues other than wine (e.g. other apps) so I'm not sure if implementing a fallback is worth it. Also, should we query the location through `$XDG_DATA_HOME` instead of hard-coding it? Good idea seems it should be done like this; {width=659 height=500} -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10543#note_134781
Eeeh probably not. That being said a system that doesn't have that dir gonna have a lot of issues other than wine (e.g. other apps) so I'm not sure if implementing a fallback is worth it.
I think macOS doesn't create $HOME/.local by default. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10543#note_134785
Does this seem good? I'll push if so; {width=900 height=507} Edit: Quality on this video is kinda bad because I had to compress it but everything seems visible enough. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10543#note_134790
From the specification at https://specifications.freedesktop.org/basedir/latest/ :
$XDG_DATA_HOME defines the base directory relative to which user-specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.
So `$HOME/.local/share` shouldn't be hardcoded like that. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10543#note_134801
On Thu Apr 2 13:26:30 2026 +0000, Corentin Noël wrote:
From the specification at https://specifications.freedesktop.org/basedir/latest/ :
$XDG_DATA_HOME defines the base directory relative to which user-specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used. So `$HOME/.local/share` shouldn't be hardcoded like that. The latest commit seems good?
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10543#note_134805
participants (4)
-
Corentin Noël (@tintou) -
Fatih Bakal (@Twig) -
Jactry Zeng (@jactry) -
Twig6943