I was looking into how one might provide inkscape extensions using 0install[1], which basically amounts to adding extensions _without_ touching any well-known paths, typically using environment variables.
I've done the same thing for gnome-shell, by essentially adding each extension's location to $XDG_DATA_DIRS. So for example to run gnome-shell with the shellshape extension[2], $XDG_DATA_DIRS might contain the following dir:
/home/tim/.cache/0install.net/implementations/sha256=2437376cd245ee4f09b0738e1cc7392a04750a9cec4b0875bf71606703d9ee01/xdg
which contains a `gnome-shell` directory with the files you would normally put in /usr/share/gnome-shell if you were installing them system-wide.
I wondered if this would work for inkscape as well, but after having a look at the source, it doesn't seem likely. Based on the `profile_path` function in inkscape.cpp:
- inkscape seems to assume that there will be at most one folder for each of (user, system) level preferences - it assumes preferences and extensions will all live in the same location.
These both go against the XDG spec[3], which recommends that config and data live in different locations and should be able to be looked up in a cascading fashion (i.e supporting multiple paths in $XDG_DATA_DIRS). These restrictions also make it very difficult to use 0install to distribute extensions since that would require: - readonly `extensions` directories - all 0install implementation directories must be read-only as they can be shared between users (among other reasons) - cascading lookup of extensions in _all_ paths in $XDG_DATA_DIRS - adding or removing plugins must be possible by affecting what is in XDG_DATA_DIRS, rather than modifying folders in the filesystem.
So, I guess my questions are: - am I wrong about my conclusions here? I've looked at the source, but may have missed something. - is there any interest in extending the extension loading mechanism to support loading extensions across all $XDG_DATA_DIRS? Presumably this would be implemented for _all_ data types (gradients, icons, etc) as well as just extensions.
Cheers, - Tim.
[1]: http://0install.net/ [2]: http://gfxmonk.net/dist/0install/shellshape.xml [3]: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html