xwmx / nb

CLI and local web plain text note‑taking, bookmarking, and archiving with linking, tagging, filtering, search, Git versioning & syncing, Pandoc conversion, + more, in a single portable script.
https://xwmx.github.io/nb
GNU Affero General Public License v3.0
6.43k stars 180 forks source link

[Feature request] Automatic alternative NBRC_PATH #277

Open tkapias opened 8 months ago

tkapias commented 8 months ago

I'm trying to clean my $HOME as much as possible by using the advices of a nice tool called xdg-ninja.

Currently nb is not really clean friendly, the .nbrc files need to be at the root of the user's home directory or defined by exporting NBRC_PATH. Then a few variables need to be defined in this file for the history, the main dir and main notebook.

By default there will be 3 new entries in $HOME:

I put the dotfiles in $HOME/.config/nb ($XDG_CONFIG_HOME/nb) and the main directory in $HOME/Notes/nb.

For this to work I had to:

In addition, by defining NB_HIST I think that I'm loosing some feature, because in the script NB_HIST is composed with $ME and can generate differente history files. By defining it I'm consolidating them all.

Could you add a check for $XDG_CONFIG_HOME/nb/nbrc or $HOME/.config/nb/nbrc? In presence of this file only NBRC_PATH and NB_HIST could be generated internally and make the setup more friendly.