dstask
dstask copied to clipboard
Use $XDG_CONFIG_HOME for config dir
Currently the dstask config file lives in ~/.dstask
. It'd be great to follow the XDG Base Directory Specification and move this into ~/.config/dstask/config
. This way, it doesn't clog up our home directory.
The spec is here: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
Thanks!
ignore this, I didn't realise that much more than configuration lives in ~/.dstask
. Still it might be worth a read anyway :+1:
Actually, we don't have a lot of runtime config right now. The ~/.dstask is the default location of the task database, which, in the XDG desktop spec, would probably be more like the "data" directory.
Since we don't have much config required, all we need is just environment variables. This may change, though. I'm a fan of the XDG spec, myself.
Please reopen this - you probably have to split the files up across the XDG dirs, but that's the point. I want a clean HOME :)
So where would a data directory go in the XDG spec? I can't seem to find out (but haven't looked hard). Happy to have the dstask configuration file in .config/dstask/dstask.yml
when dstask has things to configure. So far it's been unnecessary but a few users have requested things that would require config such as theming.
Arch Wiki has a succinct description for linux systems: https://wiki.archlinux.org/index.php/XDG_Base_Directory
When it comes to MacOS, there are a few philosophies
- use the same directories as linux regular users, if you're writing a cli app for a regular user
- Use the ~/Library paths for data dir and cache dir, but still use ~/.config for config, because c'mon
Normally I'm never messing with the data dir or the cache dir of apps directly, but dstask is special, since manual git commands are sometimes required.
One Windows, there are probably opinions that we shouldn't mess with, but I don't know what those are.
Arch Wiki has a succinct description for linux systems: https://wiki.archlinux.org/index.php/XDG_Base_Directory
The arch wiki always has the answer! ~/.local/share/
in this case.
put is in the same place as linux regular users, if you're writing a cli app for a regular user
Good for consistency
but dstask is special, since manual git commands are sometimes required.
I think you're right. I'll leave it as is, at least for now.
but dstask is special, since manual git commands are sometimes required.
I think you're right. I'll leave it as is, at least for now.
How is this special? These statements and conclusions don't make sense to me ^^
@xerus2000 I should clarify. What I meant here was we should not use the ~/Library path if we adopt xdg. My reasoning here is that for MacOS apps that use these paths, the structure there is usually pretty weird looking. See the SO link pasted above.
To wit, I would advocate number 1 in my previous comment.
And to anyone else coming across this issue, you can change the git repo location right now with export DSTASK_GIT_REPO=
in your bashrc.
this lib seems pretty nice. https://github.com/adrg/xdg . had a cursory look through the code, seems to implement things correctly, has tests and supports darwin and windows as well (see their readme and check if those paths look sensible for windows/mac). does a bit more than what we need but is lightweight anyway.
https://github.com/adrg/xdg#xdg-base-directory > the dirs listed here for unix seems fine. Do we have any windows/mac users amongst us who can "sign off" on these paths? Note this lib uses ~/Library/Preferences which seems a bit contentious. But I'ld like to just pick a library and go forward with it. @dontlaugh do you use mac?
https://github.com/adrg/xdg#xdg-base-directory > the dirs listed here for unix seems fine. Do we have any windows/mac users amongst us who can "sign off" on these paths? Note this lib uses ~/Library/Preferences which seems a bit contentious. But I'ld like to just pick a library and go forward with it. --
@Dieterbe Not anymore :). The library now suggests writing files relative to the ~/Library/Application Support
directory,
if XDG_CONFIG_HOME
is not set. However, it can find config files relative to ~/Library/Preferences
, /Library/Application Support
and /Library/Preferences
as well.
whoever has time for it, let's go forward with this library. thanks for your input @adrg :)