Re: Questions
BARDOT Jérôme <[email protected]> Mon, 22 Nov 2021 08:28:27 +0100
| Newsgroups | gmane.linux.xdg.devel |
|---|---|
| Message-ID | <[email protected]> |
Thx Yes it is (helpfull). I already know some stuff i just need to make stuff i need works. :) I first come here for some data approch too. Do you think about more data like ebooks that can be great to have ? where each application basically just has its own sandboxed home folder => most stupid thing in the world We need an appropriate data security policies tool with an real identity manager. And i currently try to working on a such tool. If people here have ideas feel free to share. J. On 20/11/2021 20:15, Elsie Hupp wrote: > Hi Jérôme, > > The Arch Wiki has a pretty good guide to the `xdg-user-dirs` package installed on most Linux distributions: > > https://wiki.archlinux.org/title/XDG_user_directories > > I’ve dug around in the boilerplate code for *looking up* `xdg-user-dirs`, and it basically queries `XDG_FOOBAR_DIR` for `FOOBAR`, so you *should* basically be able to define any custom folder you want. You can check out my pending pull request on `pyxdg` for a version of the code that’s somewhat easier to read than the original C: > > https://gitlab.freedesktop.org/xdg/pyxdg/-/merge_requests/13 > > The actual Python file: > > https://gitlab.freedesktop.org/xdg/pyxdg/-/blob/8fa45fbbe4cd6676b388ca0549f875739301ed21/xdg/UserDirectory.py > > Note that this is a simplified line-by-line translation of `xdg-user-dir-lookup`: > > https://gitlab.freedesktop.org/xdg/xdg-user-dirs/-/blob/master/xdg-user-dir-lookup.c > > However, a big part of the functionality behind `xdg-user-dirs` is (a) the basic list is standardized across most Linux distros, and (b) the actual name of the directory is localized into a large number of natural languages. > > The main reason actually that I joined this mailing list was to ask about directories for difficult-to-categorize use cases, like ebooks or podcasts (or code repositories or, yes, games). > > So, hypothetically, yes, you could define your own `xdg-user-dirs`. However, `xdg-user-dirs` is a tool rather than standard, and even if you got a pull request approved for some additional directory, it would probably take years to percolate out through the install base and never actually reach 100% of users. Oh, and you’d also need to get it adopted by both GLib and Qt. (Qt would probably be easier, considering Windows does IIRC have a `My Games` directory, so there’s already a cross-platform precedent.) > > This is to say that if you define your own custom directories in `xdg-user-dirs` in application code, you should always define a fallback. And in some respects `xdg-user-dirs` is kind of falling out of fashion with the rise in Flatpak and Snap for end-user applications, where each application basically just has its own sandboxed home folder, rather than using a shared per-content-type directory, even though Flatpak portals do increasingly support arbitrary locations in userspace. > > Anyway, I hope this is helpful! > > Best, > Elsie Hupp > >> On Nov 19, 2021, at 3:51 PM, Jérôme Bardot <[email protected]> wrote: >> >> Hello, >> >> There is a way to to add this own stuff in XDG_CONFIG_HOME/user-dirs.dirs ? I want a XDG_GAMES_DIR= >> >> Also can i access to XDG var from a shell ? >> >> thx >> >> More specifically someone can mentor me to push stuff if needed ? >>