Files
vns/README.md

3.4 KiB

Simple Note System

About

The Simple Note System is a shell script partially inspired by pass, in that it stores notes as normal, plaintext, files in normal folders. It uses the environment-specified editor, and can be configured to use GPG encryption.

SNS was originally conceived one morning during an update to a popular note-taking app. The thought occurred that a note system need not reinvent the wheel with its own GUI editor and proprietary file format, but instead could use the tools already provided by the operating system.

As it developed, OpenSSL encryption was dropped in favor of GPG, and the script was almost entirely rewritten as SNSv2.

simple note system
==================

usage: sns [-cedlp] <notebook/section/name>
       sns [-hi]
  -c | --create : Create note
  -d | --delete : Delete note
  -e | --edit   : Open note for editing
  -h | --help   : Display this message
  -i | --init   : Write default config and initalize SNS store"
  -l | --list   : List all notes in NOTEBOOK
  -p | --print  : Print note to console

Installing

Notice:

If you are upgrading to SNS 2.0a11 from an earlier version, please move $HOME/.config/sns to $HOME/.local/sns

To install, place sns.sh in your path, and copy src/bash-completion/sns to /usr/share/bash-completion/completions/sns.

Or simply run ./install.sh.

To uninstall, remove the files you copied, or run ./install.sh --uninstall

Once installed, SNS will require you to run sns -i, to indicate you would like to create its note store and write its default configuration.

By default, SNS will set itself up in ~/.config/sns, with ~/.config/sns/sns.conf as its configuration file.

Configuration

In the configuration file, ~/.config/sns/sns.conf you can change the following properties of SNS:

  • The file extension to use for notes

    The default is .note, however you might change it to .md for editor autodetection.

  • The editor SNS calls

    SNS will refuse to run if $EDITOR isn't specified by the environment, however you can set an editor here separate from the environment-specified one.

  • Date Format

    SNS adds date and time to notes and edits by default. Clearing this should remove the date/time line by default, but you can also change it to any string the date command will accept as a format.

  • Encryption

    This is SNS's main encryption toggle. It must be on for encryption to function.

  • Public Key

    SNS requires the identifier of a GPG public key for encryption to function.

A word about encryption: Enabling encryption will cause problems if previously un-encrypted notes exist. In the future, I'd like to resolve these, however for the time being it's best to decide when you install SNS if you'd like to enable encryption or not. Encryption amendment: As of SNS 2a10, experimental support is in place for migrating between encrypted and unencrypted note stores.

Tips and Tricks

  • To list all notes in all notebooks, use sns -l .

Credits

The majority of the code here is my own, however the bash completion code comes from pass, the standard UNIX package manager, along with some design and feature ideas.

License

Simple Note System is licensed under the terms of the GNU General Public License Version 2, as detailed in LICENSE.

Bugs

If something seems off, or just doesn't work, please open an issue and I'll look into it.