Avidemux Forum

Participate => Patch gallery => Topic started by: vidergaray on October 25, 2023, 06:22:27 PM

Title: Use XDG Base Directory (Linux)
Post by: vidergaray on October 25, 2023, 06:22:27 PM
Here's a patch to use the XDG Base Directory (https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) specification for "the base directory relative to which user-specific data files should be stored" instead of storing it in the user's HOME, in Linux.

xdg.patch.txt
Title: Re: Use XDG Base Directory (Linux)
Post by: eumagga0x2a on October 25, 2023, 10:13:44 PM
Thank you, I don't think XDG_DATA_HOME or ~/.local/share is the right place, shouldn't it be XDG_CONFIG_HOME (~/.config) instead?

I'd also drop "6" from the profile directory name, "6" was necessary over a decade ago to allow co-existence with predecessors of what is now Avidemux.
Title: Re: Use XDG Base Directory (Linux)
Post by: vidergaray on October 25, 2023, 10:51:10 PM
It seemed to be more than just configuration files in the directory so I used XDG_DATA_HOME, but I'd be just as happy with XDG_CONFIG_HOME so long as it's out of my HOME directory.

Here's a patch for the patch lol:
10c10
< +    char* homeEnv = getenv("XDG_DATA_HOME");
---
> +    char* homeEnv = getenv("XDG_CONFIG_HOME");
22c22
< +            strcat(ADM_basedir, "/.local/share");
---
> +            strcat(ADM_basedir, "/.config");
35c35
< +    const char *ADM_DIR_NAME = "avidemux6";
---
> +    const char *ADM_DIR_NAME = "avidemux";

Title: Re: Use XDG Base Directory (Linux)
Post by: eumagga0x2a on October 25, 2023, 11:02:08 PM
I'll test the patch tomorrow. If it gets accepted, how shall it be attributed in the commit message? By your nick in the forum? A real name which you would need to reveal then?
Title: Re: Use XDG Base Directory (Linux)
Post by: vidergaray on October 25, 2023, 11:20:46 PM
Thanks, I am Hildigerr Vergaray.