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

$XDG_DATA_DIR not defined #21

Open
fekir opened this issue May 17, 2015 · 2 comments
Open

$XDG_DATA_DIR not defined #21

fekir opened this issue May 17, 2015 · 2 comments

Comments

@fekir
Copy link

fekir commented May 17, 2015

In the README it is described how plugins are loaded from $XDG_DATA_DIR. This variable is not defined on my computer, and isn't apparently described at freedesktop.org

Maybe it was meant the variable $XDG_DATA_DIRS (final S!)

@oz123
Copy link

oz123 commented May 22, 2016

What is meant with $XDG_DATA_DIRS is the application directories laying in XDG_HOME

From the specification:

 $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. 
 $XDG_DATA_DIRS defines the preference-ordered set of base directories to search for data files in addition to the $XDG_DATA_HOME base directory. The directories in $XDG_DATA_DIRS should be seperated with a colon ':'. 

So you specify it yourself.

Also, looking at the source code you can see that plugins are loaded from any of those dirs you specified or from the default:

// Look in XDG_DATA_DIR, ~/.local/share/caja-python/extensions

    // Look in XDG_DATA_DIR, ~/.local/share/caja-python/extensions
    user_extensions_dir = g_build_filename(g_get_user_data_dir(), 
        "caja-python", "extensions", NULL);
    caja_python_load_dir(module, user_extensions_dir);

See here: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

@fekir
Copy link
Author

fekir commented Jun 5, 2016

I'm sorry, but I'm still confused.

g_get_user_data_dir() should return, on my pc "/.local/share", so in that snippet g_build_filename should return "/.local/share/caja-python/extensions".

I've no idea what DATADIR is set, to, but it seems to be a macro, so it's set at compile time, and I guess it'll be /usr/share (on GNU/Linux), so that the final path is /usr/share/caja-python/extensions.

I do not get the correlation between XDG_DATA_DIR (not used in the source, it's only there as a comment, and not defined in https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html), and the other two paths that I've mentioned (and also reported in the README).

The only variable, as far as I can see, I can configure, is the $XDG_DATA_HOME, but specifying $XDG_DATA_DIR myself, like you said and described in the README, would have no effect, or did I miss something?

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

No branches or pull requests

2 participants