Jon-William Lewis 61396cfa44 Revert "Formatting changes"
This reverts commit f156e9bbe5.

Restoring this commit pending a rewrite.
2016-10-01 17:00:23 -05:00
2016-10-01 17:00:23 -05:00
2016-10-01 17:00:23 -05:00
2016-08-27 13:07:34 -05:00
2016-02-15 19:59:53 -06:00
2016-08-11 16:02:08 -05:00

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.

  • Version Control program SNS can be configured to use a version control program such as Git, Mercurial, Subversion, etc. When configured, SNS can pass commands through to the specified program in the context of SNS's store. For example, if Git was configured here, then sns git init would initialize a Git repository for your notes; sns git remote add could be used to add a remote repo, and sns git push could push committed changes to the notes store to that remote.

A word about encryption: When editing an encrypted note, SNS will decrypt the note to a temporary file inside its store. The temporary file will have a random name, but a predictable location. It can only be read by the user and root, and is deleted after editing, but can be recovered by forensic utilities. SNS's encryption is mainly useful when the store is being transferred over a network.

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.

Description
Shell script for managing a store of encrypted plain-text notes
Readme 256 KiB
Languages
Shell 100%