Add support for XDG config home directory #77

Manually merged
asdf merged 1 commits from add-xdg-config into develop 2019-11-12 06:58:11 +00:00
Collaborator

Add functionality requested in #55.

Before this is merged in, we will need to decide on the default in the repo. Currently it is set to use XDG config home for demonstration purposes.

There is a test for this, and while they helped with development they are not good and will fail. They could be useful, but would require mocking things.

A couple of questions:

  • Is the documentation too long?
  • Is it ok to have the functions at the bottom?
Add functionality requested in #55. Before this is merged in, we will need to decide on the default in the repo. Currently it is set to use XDG config home for demonstration purposes. There is a test for this, and while they helped with development they are not good and will fail. They could be useful, but would require mocking things. A couple of questions: - Is the documentation too long? - Is it ok to have the functions at the bottom?
asdf self-assigned this 2019-11-07 02:08:42 +00:00
sloum was assigned by asdf 2019-11-07 02:08:42 +00:00
asdf added the
enhancement
documentation
labels 2019-11-07 02:08:42 +00:00
Owner
  1. I do not think the documentation is too long. A big goal for me with this project is that it doesn't fall into what C code was for me for so long: a big mystery that would always break when I tried to compile it. I think thorough docs like this may allow a non-programmer (or novice) to edit and build the system.

  2. Yes.

  3. My preference for default is the home folder. That said, it is a personal preference. I had never heard of the XDG foldering setup... if a lot of people use this, it may be a good call. What do you think?

1. I do not think the documentation is too long. A big goal for me with this project is that it doesn't fall into what C code was for me for so long: a big mystery that would always break when I tried to compile it. I think thorough docs like this may allow a non-programmer (or novice) to edit and build the system. 2. Yes. 3. My preference for default is the home folder. That said, it is a personal preference. I had never heard of the XDG foldering setup... if a lot of people use this, it may be a good call. What do you think?
sloum approved these changes 2019-11-07 05:52:41 +00:00
Author
Collaborator

Thanks for the feedback.

Regarding the default settings, I tried searching for more information about people's preferences. I found that:

  • Discussion on XDG base directories is typically "how can I make some app save to ~/.config" or "can you please add support for XDG config home"
  • People dislike having lots of files in their home directories, they feel it's messy
  • Using XDG base directories is the new, standard way of doing things. Using home is old and outdated.
  • There are also a fair few blog posts making the same two points
  • Sometimes, technical reasoning is supplied that supports the use of XDG base directories
  • It is actually a standard, officially documented, and a lot of applications implement it
  • Having configuration saved to a single, standard folder can help with managing that data (for backup or migration or whatever) and the same applies for the other base directory types like cache
  • There doesn't seem to be many instances of people preferring the use of the home directory, or disliking XDG base directories - it's hard to find discussion that differs from the first point

I'd recommend searching on the topic to see if you get the same impression.

Maybe there is another issue though - is there a way to keep defaults each time you have to git pull to get the latest version?

Thanks for the feedback. Regarding the default settings, I tried searching for more information about people's preferences. I found that: - Discussion on XDG base directories is typically "how can I make some app save to ~/.config" or "can you please add support for XDG config home" - People dislike having lots of files in their home directories, they feel it's messy - Using XDG base directories is the new, standard way of doing things. Using home is old and outdated. - There are also a fair few blog posts making the same two points - Sometimes, technical reasoning is supplied that supports the use of XDG base directories - It is actually a standard, officially documented, and a lot of applications implement it - Having configuration saved to a single, standard folder can help with managing that data (for backup or migration or whatever) and the same applies for the other base directory types like cache - There doesn't seem to be many instances of people preferring the use of the home directory, or disliking XDG base directories - it's hard to find discussion that differs from the first point I'd recommend searching on the topic to see if you get the same impression. Maybe there is another issue though - is there a way to keep defaults each time you have to `git pull` to get the latest version?
Author
Collaborator

OK, I've done some more work on this. I'll point out what it does and does not do, so we are clear on what is changing and what might be considered outstanding.

What it does:

  • Sets XDG config home as the location for .bombadillo.ini by default
  • Documents this setting, as well as defaults.go

What it doesn't do:

  • Advise users that the location is different for version 2, or assist them with migration of their settings file
  • Help users keep their defaults.go changes each time they "git pull" to get updates
  • Save the settings to a non-hidden file to the XDG config home directory (i.e. ~/.config/bombadillo.ini)

The first point should be handled in some release documentation, and the other two add a lot of complexity.

I'd recommend with going ahead as is, based on my previous comments. If you still have a strong preference to keep the default configlocation path as the home directory, I'd be happy to stay with that too.

If it helps, you can use the command XDG_CONFIG_HOME=~ ./bombadillo to override just for Bombadillo.

OK, I've done some more work on this. I'll point out what it does and does not do, so we are clear on what is changing and what might be considered outstanding. What it does: - Sets XDG config home as the location for .bombadillo.ini by default - Documents this setting, as well as defaults.go What it doesn't do: - Advise users that the location is different for version 2, or assist them with migration of their settings file - Help users keep their defaults.go changes each time they "git pull" to get updates - Save the settings to a non-hidden file to the XDG config home directory (`i.e. ~/.config/bombadillo.ini`) The first point should be handled in some release documentation, and the other two add a lot of complexity. I'd recommend with going ahead as is, based on my previous comments. If you still have a strong preference to keep the default `configlocation` path as the home directory, I'd be happy to stay with that too. If it helps, you can use the command `XDG_CONFIG_HOME=~ ./bombadillo` to override just for Bombadillo.
sloum approved these changes 2019-11-12 03:22:36 +00:00
sloum left a comment
Owner

I approve this update. I'll add XDG_CONFIG_HOME=~ as an export in my shell.

I approve this update. I'll add `XDG_CONFIG_HOME=~` as an export in my shell.
bombadillo.1 Outdated
@ -200,3 +200,3 @@
Writes data from a given link id in the current document to a file. The file is named by the last component of the url path. If the last component is blank or fI/fP a default name will be used. The file saves to the directory set by the fIsavelocationfP setting. fIwfP can be entered rather than the full fIwritefP.
.SH FILES
fBbombadillofP keeps a hidden configuration file in a user's home directory. The file is a simplified ini file titled fI.bombadillo.inifP. It is generated when a user first loads fBbombadillofP and is updated with bookmarks and settings as a user adds them. The file can be directly edited, but it is best to use the SET command to update settings whenever possible. To return to the state of a fresh install, simply remove the file and a new one will be generated with the fBbombadillofP defaults. On some systems an administrator may set the configuration file location to somewhere other than a user's home directory. If you do not see the file where you expect it, contact your system administrator.
fBbombadillofP keeps a hidden configuration file in a user's XDG configuration directory. The file is a simplified ini file titled fI.bombadillo.inifP. It is generated when a user first loads fBbombadillofP and is updated with bookmarks and settings as a user adds them. The file can be directly edited, but it is best to use the SET command to update settings whenever possible. To return to the state of a fresh install, simply remove the file and a new one will be generated with the fBbombadillofP defaults. On some systems an administrator may set the configuration file location to somewhere other than the default setting. If you do not see the file where you expect it, or if your settings are not being read, contact your system administrator.
Owner

Something maybe worth noting at the end is that you can run :check configlocation to see where it is currently set. You just cannot run set to alter that once bombadillo is compiled.

Something maybe worth noting at the end is that you can run `:check configlocation` to see where it is currently set. You just cannot run `set` to alter that once bombadillo is compiled.
Owner

Unless you have anything you'd like to add, I'll merge this in (or you can when you see this comment, either way). Also, not sure if you saw but you have mail at rtc from me. The first one has been largely cleared up as we have worked through the issues and PRs here so can mostly be disregarded. Let me know re: the last one.

Unless you have anything you'd like to add, I'll merge this in (or you can when you see this comment, either way). Also, not sure if you saw but you have mail at rtc from me. The first one has been largely cleared up as we have worked through the issues and PRs here so can mostly be disregarded. Let me know re: the last one.
Author
Collaborator

Thanks, I'll merge this in once I correct the change commits (I tried to update it so it could merge without tripling the number of commits). I'll also check my email soon!

Thanks, I'll merge this in once I correct the change commits (I tried to update it so it could merge without tripling the number of commits). I'll also check my email soon!
asdf changed title from WIP Add support for XDG config home directory to Add support for XDG config home directory 2019-11-12 06:57:37 +00:00
asdf closed this pull request 2019-11-12 06:58:10 +00:00
asdf deleted branch add-xdg-config 2019-11-12 06:58:18 +00:00
Author
Collaborator

Uh fix for #55

Uh fix for #55
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sloum/bombadillo#77
No description provided.