Shell Scripts to Facilitate Effective Note Taking
Shell Scripts to Facilitate Effective Note Taking
This is a self-contained shell script that uses pre-existing tools (such as TMSU and recoll) to provide an interface for markdown notes.
It's command based and prints out available subcommands for any given command, these means you can use a directory of markdown files like a personal wiki, much like OneNote/Evernote/Notable, for example:
and an overview of what it looks like in the terminal
For example if you wanted to extract all the tags from your markdown notes (either
#tagsor from the YAML), cadmus has a tool for that:
Ultimately the idea is it is to act a menu to dispatch different scripts I already had so I could more easily share those scripts with classmates.
The real heavy lifting is done by Pandoc, Recoll, ripgrep, skim/fzf, TMSU etc.
cadmus is available on the AUR, generally however cadmus will operate in a portable fashion to
~/.cadmus/, so just using
gitis fine as well:
Copy this into your shell:
cd $(mktemp -d) wget https://raw.githubusercontent.com/RyanGreenup/cadmus/master/install.sh bash install.sh
~/.local/bin
~/.cadmus
To install manually:
Download cadmus and put it into the
PATH
bash git clone https://github.com/RyanGreenup/cadmus ~/.cadmus \ || echo "Delete $HOME/.cadmus first" mkdir -p $HOME/.local/bin ln -s "$HOME/.cadmus/bin/cadmus" "$HOME/.local/bin/"
According to the SystemD Standard
~/.local/binshould be in
$PATH, if you are using some other init implementation you can add this directory to
"$PATH"it by doing something like this:
## Should work in bash/zsh/fish echo $PATH | grep "$HOME/.local/bin" &> /dev/null && echo "$HOME/.local/bin in path already" || ls "$HOME/.local/bin" &> /dev/null && echo 'PATH="$PATH:$HOME/.local/bin"' >> $HOME/.profile
When first run, the script will prompt you to make a config file in the directory in which it is run.
It is assumed that:
.mdextension
cadmus search.
grep | cut | xargs findto avoid creating a variable), I don't know if HDD performance would be great.
xdg-openand have GNU coreutils, so do something like:
bash alias xdg-open='open &>/dev/null' alias realpath=grealpath &>/dev/null
Currently the search just uses the default recoll config, I intend to modify this to use
~/.cadmusas a config directory so as to not interfere with the default config.
It isn't in practice an issue if
~/.recollis indexing more than the notes because you can just modify the call to Skim (
sk) in ..cadmus.. to start the call with
~/Notes/MD. <!--- By default Cadmus will use a rcoll configuration at
~/.cadmus, this is to ensure that it doesn't conflict with any previous configuration.
Set this up by performing:
mkdir ~/.cadmus recoll -c ~/.cadmus
then select index configuration and configure recoll to have
~/Notes/MDas the top directory and to exclude
~, ideally
recollwill index live which can configured with indexing schedule. Recoll will then start indexing the files and afterwards (β 1-2 minutes) the GUI will pop up and you can confirm that the indexing was successful.
|:note: NOTE| | --- | | If you want to change the notes directory change the variable
NOTES_DIRin *cadmus* |
-->
description.bash
STDIN)
-hor
--helphelp will be printed and then
exit 0
scriptname './' | xargs realpath --relative-to='./'
pcre2, this comes in Arch, if using
cargo:
bash cargo install ripgrep --features 'pcre2'
tmsuAUR
If any dependencies are installed with
pipor
cargoit will be necessary to add these directories to your
PATH:
## bash echo ' export PATH="$HOME/.local/bin:$PATH" export PATH="$HOME/.cargo/bin:$PATH" ' >> ~/.bashrczsh
echo ' export PATH="$HOME/.local/bin:$PATH" export PATH="$HOME/.cargo/bin:$PATH" ' >> ~/.bashrc
fish
echo ' set PATH $HOME/.local/bin $PATH set PATH $HOME/bin $PATH set PATH "$HOME/.cargo/bin $PATH ' >> ~/.config/fish/config.fish
I wrote all this with aliases in mind, when I settle on some aliases i'll put up my
fishfunctions. (I also wanted autocomplete)
So the boxes I needed ticked are, more or less: π | | FOSS | Offline | Linux/BSD? | terminal? | RawFiles? | Markdown | AnyEditor? | |-----------|------|---------|------------|-----------|-----------|----------|------------| | OneNote | β | β | β | β | β | β | β | | EverNote | β | ? | β | β | β | β | β | | Notable | β | β | β | β | β | β | β | | Zim | β | β | β | β | β | β | β | | Obsidian | β | β | β | β | β | β | β | | dokuwiki | β | β | β | β | β | β * | β | | joplin | β | β | β | β | β | β | β β | | mediawiki | β | β | β | β | β | β | β β‘ | | Org-Mode | β | β | β | β | β | β | β | | Cadmus | β | β | β | β | β | β | β |
β You can't open the files from vim with FZF so it gets a no.
β‘ Unlike dokuwiki everything is in a database so it gets a no
* With a Plugin