Skip to content
Will Russell edited this page May 25, 2021 · 3 revisions

Welcome to the notes wiki!

generally this applet will improve in the next few days but for now basic functionality is achieved by adding this script to your $PATH -->

I've got it sitting in my ~/bin folder but you can move it to /usr/bin and it'll execute from there no trouble so long as you've made it executable.

How to use the script:

  1. clone this repository or copy the code to a local file directly
  2. make it executable with: sudo chmod a+x and move it to wherever you'd like to call it from, or export PATH=${PATH}:/path/to/this/cloned/repo to make it executable from anywhere. (I recommend this so you can git pull updates later and it'll remain valid). --> you'll need to 'SET' the path by adding it to your ~/.bashrc or equivalent for permanent access otherwise export it again each restart.
  3. the script when called for the first time will create a ~/.notes.conf file with variables in it, and a folder ~/my-notes for storing data + create a single note called 'example' (which you can call with: notes example -- though be mindful it won't be there until after you run 'notes' one time)
  4. call the applet with 'notes [options] [note-name]'
  5. run 'notes -h' first so you can read the quick-use help and start writing notes with notes -n
  6. run 'notes example' so you can get a sense of usage and get started.

notes uses CAT to read the contents of a note to the CLI if you offer it the name of the note you want to read:

$ notes example "hey cool!"

notes will also create a new note *(uses vim) if you offer it the flag -n and a name for a file (also edits existing notes if you specify the name):

notes -n "new_note" Vim editor (quit vim with :wq or :q! to not save) --> you can adjust the editor by modifying the notes script line $editor to point at 'nano' or other cli editor of choice 'emacs' whatever.

you can also do two types of query with notes:

notes -l ==> lists all note titles. (tab completion is functional now if enabled during first time setup or by following steps in the README.MD file - however, the tab completion list is only refreshed each time the shell launches, so notes -l is useful to list all note names if you create a bunch of new ones during the same session. I'm working on how to have 'notes -l' refresh the tab-completion list but so far it seems pretty centered on refreshing whenever you re-launch your shell session). This is a known bug/feature of how 'complete -W' works.

you can also use grep with notes with the -g flag. To be added is specifying which note the grep comes from, but the point really is more about 'I'm seeking this string tell me what I might have written about it without showing the whole note' - by default appends + 2 additional lines after successful match. Most useful if you have a larger note with a number of entries

notes -g "hey"

"hey cool!"

if you get lost notes -h or notes --help will display this text and a few examples.

Feel free to drop a pull request if you have a way to improve with more features or wanted to suggest some new handler routines besides find and grep. I would also encourage you to submit issues if you find them. Mostly I built this so I can have a quick note system similar to TLDR but with more of a focus on "remembering syntax for nmcli commands in the field" or "what is the layout of an ipv6 address and some examples" --> less explicitly for COMMANDS but more APPLIED USAGE. Also nice to have a quick space to dump thoughts and query them later.

Clone this wiki locally