Use XDG config spec #55
Labels
No Label
blocked
bug
build
documentation
duplicate
enhancement
finger
gemini
gopher
help wanted
http
in progress
invalid
local
needs-info
non-code
non-functional
non-urgent
question
release
rendering
suggestion
telnet
terminal
urgent
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sloum/bombadillo#55
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This would mean using the value of
$XDG_CONFIG_HOME
or~/.config
if unset: see the spec for more info. This will help prevent additional dotfiles piling up in users' homedirs.There could be a fallback:
$XDG_CONFIG_HOME/bombadillo/bombadillo.ini
$XDG_CONFIG_HOME/bombadillo.ini
~/.bombadillo.ini
This is interesting. I had not heard about this. A quick look shows that none of my machines seem to have this set by default. However, support for this should be reasonably possible.
I'll read more about this, but a preliminary look seems like it would be a good fit.
I'm trying to institute a feature freeze right now for v2.0.0, in order to finally get it completed as an official release (so only fixing bugs, working on the makefile/packaging, and documentation). I'll think on whether this should be put in as a last minute add-in or bumped to v2.1.0, but I think it likely it will make it in at some point in the not distant future.
I'll keep this issue open and comment as things develop.
@ben I just realized that this is a configuration setting that an administrator can already make at compile time. If you look in
defaults.go
you will see a number of settings that are meant to be changed by the person compiling the program. I will be updating the readme to make this clear before 2.0.0 is released. That said, I added some notes (in one of the branches awaiting a PR intodevelop
that comments out the exact setting you are wanting to have updated.I am going to leave this issue open until I update the
README
and then close it, unless there are further comments or thedefaults
file cannot be used to achieve your goal.I am in favor of this approach as it requires no code to implement, the functionality is already there. It also provides flexibility for differing opinions on where a file of this sort should go: each person compiling the program can set it as best fits their system.
Good suggestion @ben , I've seen a lot of people talking about filling up home directories with dot files, and had thought about this myself.
@sloum - having the compile-time configuration in defaults is useful to address this request. I'm in favour of this approach for now. Perhaps this could be changed to
~/.config/bombadillo.ini
as the default setting.My own interpretation of implementing XDG config spec would be that bombadillo should choose a configuration file location, in the following order:
defaults
file (which would be blank by default, but allows override)$XDG_CONFIG_HOME
(if set)$HOME/.config/
$HOME
(read only, for backward compatibility only - no new config files to be saved here)This way, new config files would sit in the appropriate location, but the existing way of working would not be affected.
If this approach is something we could agree upon, I can implement it in a couple of weeks time.
Having thought about it more I'm in favor if just having admins set it in the defaults rather than add logic to look in different places. The structure exists already, and admins or individual users can set this easily to suit the needs of their system.
While I would not in say that Bombadillo follows the suckless philosophy of code compactness... I do feel like this is the exact situation that they try to prevent in their software: lots of checks and backups to checks for settings that could just get set once in a static file.
Personally I prefer everything being in
~
, so that may be a part of my resistance; combined with what I view as code bulk forming in places that do not do much to make Bombadillo a better client for its intended purpose.That all having been said, if you think it better to go the other way @asdf I am open to it, but I would want it to be pushed to a 2.0.1+ release. My one request in that instance is that item 4 gets changed to read and write, as I do not like the idea of restricting how a user structures their filesystem.
Really good points @sloum , I wouldn't want to add unnecessary bloat and complexity where it adds little value. Nor should any further work delay the release.
For reference, this article is how I know about the xdg base dirs, and you can see it comes from a (very emotive) desire to have less in the root of home (which is already possible). It could also be considered a desire to store application data in a standard way.
A minimal way of implementing this would be to have a function that just does the XDG config path thing (return
$XDG_CONFIG_HOME
if set, or$HOME/.config/
). Indefaults.go
, the new function can be optionally used:"configlocation": NewFunction()
It could even be an inline, anonymous function in defaults.go (maybe?).
What do you think of this approach?
I am ok with this approach. It fits a nice balance between not forcing a behavior and not adding too much code for this feature.
something like the following might work:
having both of those in the defaults.go file (with solid commenting) should let someone easily choose the one that fits best. I originally thought combining it into a single function and passing a bool might be good, but the naming inherent in having both makes things more clear when you are reading the defaults map.
Above the default in question we should show three examples: the xdg function, the home function, and then let people know they can just write a path if they prefer. I'd like non-developers to be able to set up their config and I think moving the logic into functions helps with that (when we provide the calling syntax in a comment).
This has a green light from me.
The only question that remains is which default does it ship with as the official default? I am still in favor of home, but I am happy to have this exact issue written up in the readme so that people can know the options are there and how to set them.
Hi @ben
Support for XDG config home / base directories is now implemented in the develop branch. The configuration file
.bombadillo.ini
will be read fromXDG_CONFIG_HOME
if it exists, or~/.config
if it doesn't.If you get some free time, please feel free to try it out and let us know if it works as you expect.
Thanks for raising this issue! Let us know if there's anything else that comes up.
Regards,
asdf
Hi @ben
I'll close this issue off as the feature has been implemented in the develop branch for a while now. We will let you know when the 2.0.0 release occurs, which will include your suggested feature.
Thanks again!