Using XDG folders

Lionel’s just written about how applications should use the FreeDesktop xdg folders. I like this a lot more than most people do, because my XDG folders aren’t the default. The default folders are .local/share, .config, and .cache. Now, to me, having my settings be in an invisible folder defeats the point. So my folders are Applications/Data, Applications/Settings, and Applications/Cache. The beauty of this is that if an app has gone mad, I can just go into Applications/Settings, find the settings file or folder for an app, and delete it. No grovelling around on the command line. It’s lovely. To do it, put this in .gnomerc*:

1
2
3
4
#!/bin/bash
export XDG_DATA_HOME=$HOME/Applications/Data
export XDG_CONFIG_HOME=$HOME/Applications/Settings
export XDG_CACHE_HOME=$HOME/Applications/Cache

and then all proper applications just store their data in there. Couple of other tiny benefits: it’s easy to see what you’ve got installed, and it’s also to see which naughty applications don’t actually check what your XDG folders are and just hardcode the defaults into their program (notify-osd, I’m looking at you here, and whatever stores motd.legal-displayed as well).

I'm currently available for hire, to help you plan, architect, and build new systems, and for technical writing and articles. You can take a look at some projects I've worked on and some of my writing. If you'd like to talk about your upcoming project, do get in touch.

More in the discussion (powered by webmentions)

  • (no mentions, yet.)