- Shell 98%
- Roff 2%
A notes management tool for bash
Static Badge required shell BASH Chat on MatrixIntroduction
notesbash is a tool for managing personal notes from the command line. That
means one can use it to create, reorder, move, delete notes; search through them
by keyword/tags or recursivley by filename; link them with entries from your
main bibtex file; or simply open a note. All this is done from a TUI inside
your terminal completley written in bash.
The editing of file content itself is done using your editor of choice. Thus,
things like syntax highlighting or auto completing the notes text is
handled by the editor, not notesbash. But you can specify which editor will be
used. Furthermore, notesbash offers configurable templates for different file
formats which makes editing new notes much easier.
Requirements
notesbash doesn't require any uncommon tools, only bash (at least version 4) and Linux
coreutils.
The following commandline tools are used if available to enhance the performance:
Quick Installation
Clone the repo and afterwards run the make.sh script from inside the Git
directory. The script checks if it run as root, using sudo, or by a local
user. If run as root, it is installed system-wide, else it is installed locally:
git clone --branch release https://codeberg.org/carmatani/notesbash
cd notesbash
# To install it for single user only
./make.sh install
# To install it system-wide
sudo ./make.sh install
To uninstall the tool just run ./make.sh uninstall or sudo ./make.sh uninstall
(depending weather you've installed notesbash system-wide or only for a single user)
from inside the locally cloned Git repository.
For more install options see the Wiki.
Demo
Fuzzy search
Search by tags
Create notes
Create bibliography specific notes
Export your notes
Configuration
To configure notesbash just edit the configuration file which is installed to
$XDG_CONFIG_HOME/notesbash/notesbash.conf. If XDG-convention is not used, the
fallback path ist ~/.config/notesbash/notesbash.conf.
To work correctly, the following most important variables should be set:
- NOTESBASH_ROOT_DIR
- Set the path to the notes root directory. If variable is not set, notesbash will ask for a temporary directory.
- NOTESBASH_MAIN_BIB
- Define the path to the main .bib file used for bibnotes. If none is found, some functionality concerning bibnotes might not work.
- NOTESBASH_EDITOR (Array)
- Enter the favored editor for editing notes. Defaults to $VISUAL, $EDITOR and at last 'vi' in the given order. You can pass options to the chosen editor. Each option has to be a single array element.
- NOTESBASH_GUI_EDITOR (Boolean)
- By default,
notesbashassumes that your editor is an in-terminal programm. If you want to use an editor with GUI mode, set the toggle totrueor1sonotesbashknows, that it has to open a new window. Typical editors with GUI mode are "VSCode", "VSCodium", "Kile", "Kate", or "Emacs" with GUI mode (which is the default). - NOTESBASH_DEFAULT_EXTENSION
- Define the common extension which is usually used for the note files. It will
be used to automatically create bibnotes from bibkeys or added to the filename
if the extension was left blank. Defaults to
mdif not set. - NOTESBASH_FILE_EXTENSIONS (Array)
- Define file extensions to decide which note files are shown in the TUI. E.g.
mdfor Markdown ororgfor Emacs Org-Mode files (without the dot separating file name and extension!). If left blank, all files in the directories will be shown. It's possible to assign multiple files surrounded by parantheses:(org md pdf).
But notesbash offers many more customization possibilities. Check the
Wiki for more
information.
Usage
notesbash is mainly used with an interactive TUI from inside the terminal.
Press ? from inside the TUI to show possible keybindings, or check the Wiki.
CLI commands
Beside the TUI, there are some CLI commands to run some notesbash actions
Synopsis
notesbash [main options] [subcommand] [arguments] [file]
Main options
- -h | --help
- Open the manpage and exit. Can only be used without other arguments and subcommands.
- -H | --health
- Show possible external cli-Commands notesbash can make use of to preview documents inside the terminal, as well as other optional notesbash dependencies.
- -v | --version
- Show version and exit. Can only be used without other arguments and subcommands.
- -c | --config-file=
- Set custom config file for current session only. Takes path to config file as value. Subcommands can be executed following the config-file argument.
Subcommands
- new-note [arguments] [file]
-
Create a new note from the command line
Needed arguments:
- -t | --title= Enter title for the new note. Can be passed only once
- -a | --author= Enter author. Can be passed multiple times
- -k | --keyword= | --tag= Enter tag/keyword. Can be passed multiple times
- new-bibnote [arguments] [file]
-
Create a new bibnote form the command line
Needed arguments:
- -b | --bibkey= Enter bibkey for bibnote. Cac be passed only once
- -t | --title= Enter title for the new note. Can be passed only once
- -a | --author= Enter author. Can be passed multiple times
- -k | --keyword= | --tag= Enter tag/keyword. Can be passed multiple times
- export [arguments] [file]
-
Export the given file using an exporter script
Needed arguments:
- -x | --action= Enter the export action. Possible values are 'export' and 'pdf-preview'
- -e | --exporter= Select the exporter script.
- list-all-tags
-
List all tags used for notes inside the notesbash main directory
- print-possible-exporters [arguments] [file]
-
Print all exporter scripts which can process the given file
Needed arguments
- -x | --action= Enter the export action. Possible values are 'export' and 'pdf-preview'
Licence
All code parts written by me and the other contributors is distributed under the GNU GPL 3+.
The original code is a fork of the bash file manager fff by
@dylanaraps, unmodified code from fff
is distributed under the MIT license.