1
0
mirror of https://github.com/RyanGreenup/cadmus.git synced 2025-02-21 05:03:27 +01:00
Ryan Greenup ae4613e1c4 Priorites
2020-07-14 21:36:41 +10:00
2020-07-13 01:29:53 +10:00
2020-07-13 01:29:53 +10:00
2020-07-14 07:39:09 +10:00
2020-07-13 01:29:53 +10:00
2020-07-14 01:41:31 +10:00
2020-07-14 01:41:31 +10:00
2020-07-14 21:36:41 +10:00
2020-07-14 01:38:02 +10:00
2020-07-14 00:06:27 +10:00

cadmus

Shell Scripts to Facilitate Effective Note Taking

Introduction

Essentially I used to have a dozen shell scripts in ~/bin that I use to capture notes, this is an attempt to wrap them into a single script and then have aliases to make them quick to access.

Philosophy

  • cadmus will take the notes directory from the global variable CADMUS_NOTES_DIR
    • The Actual work will be done by subscripts denoted by description.bash
      • The subscripts will take the note directory as an argument so they are portable and modular
    • The Arguments will be shifted and then all passed down to subfunctions
      • I'll just need to be careful that loose arguments aren't dangerous
  • Be a Front end to tie together different scripts and tools
  • Don't replicate work other people have done.
  • Plain Text, Open Source.
  • Be Modular
    • Pipe in input, output goes to STDOUT
    • Leave Aliases and piping to the user

Installation

To install, satisfy the dependencies and add $HOME/bin to the $PATH variable, something like this should be fairly shell agnostic:

echo $PATH | grep "$HOME/bin" &> /dev/null && echo "$HOME/bin in path already" || ls "$HOME/bin" &> /dev/null && echo 'PATH="$PATH:$HOME/bin"' >> $HOME/.profile

then copy in the scripts, with stow something like this should be sensible:

exec bash
cd ~/DotFiles

if [[ -d ".git" ]]; then
    echo "Adding Submodule";
    git submodule add https://github.com/RyanGreenup/cadmus
else echo "Cloning Repository";
    git clone https://github.com/RyanGreenup/cadmus
fi

stow -t $HOME -S cadmus
⚠️ WARNING
Stow is currently broken on Arch If you are using Stow 2.3.1-2 downgrade

Downgrade with: sudo pacman -U https://archive.archlinux.org/packages/s/stow/stow-2.2.2-5-any.pkg.tar.xz

Usage

It's all Menu driven so just follow the diagram to do what you need.

Mindmap of Program Flow

Assumptions

It is assumed that:

  1. notes are:
    1. Markdown files with a .md extension
    2. Underneath ~/Notes
    3. Recoll updates it's index on the fly
      • ~/Notes will need to be indexed by Recoll so the results will show up.
  2. You're going to use Kitty
    • You could either change the source or use anoter terminal that supports calling functions with --, e.g. kitty -- nvim
  3. SSD
    • I use an SSD and some scripts are pretty inefficient (like grep | cut | xargs find to avoid creating a variable), I don't know if things like would work on a HDD.
  4. SystemD
  5. I use Fish and Oh My Fish (OMF) as my default shell, this means basename $SHELL is fish for me and even though this is written in bash maybe that could cause issues.
    • Try Fish for a while, it's quite good, when you need to test something it's easy to temporarily jump back with exec zsh.
    • This should only matter for cadmus find where the use of Fish mmeans that results can be highlighted, I cannot get this to work with bash or zsh and I don't know why.
      • I wonder if this would work for nushell???

Dependencies

TODO


  1. From Wikipedia Recent 2.6 Linux kernel builds have started to offer /dev/shm as shared memory in the form of a ramdisk, more specifically as a world-writable directory that is stored in memory with a defined limit in /etc/default/tmpfs. /dev/shm support is completely optional within the kernel config file. ↩︎

Description
No description provided
Readme 29 MiB
Languages
CSS 64.7%
HTML 24.5%
Shell 7%
JavaScript 3%
R 0.7%
Other 0.1%