News:

--

Main Menu

Use XDG Base Directory (Linux)

Started by vidergaray, October 25, 2023, 06:22:27 PM

Previous topic - Next topic

vidergaray

Here's a patch to use the XDG Base Directory 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.

You cannot view this attachment.

eumagga0x2a

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.

vidergaray

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";


eumagga0x2a

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?

vidergaray