yafp/tnote
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
================================================================================
tnote.sh | version 0.4 | GPL v3 (see LICENSE) | 2016-02-03
Florian Poeck | https://github.com/yafp/tnote
================================================================================
TOC:
1. What is this?
2. Install / Uninstall
3. How do I use it?
4. Who made it?
1. What is this?
'tNote' is a bash script for people who prefer maintaining simple text-notes
from the command-line.
The code is based on 'cheat' by James Hendrie
2. Requirements
'tNote' relies on 'bash', 'cat', 'mv', 'rm' and the EDITOR environment variable.
For interactive mode you need as well 'dialog'.
3. Install / Uninstall
To install this script, as root, run 'make install' from inside the top
directory to which you've downloaded/extracted the program; it should be the
same directory where you found this README file.
To uninstall the program, as root and from that same directory (or whichever
directory contains the Makefile), run 'make uninstall'.
4. How do I use it?
Using this script is straightforward enough, in the typical UNIX/Linux
fashion:
tnote [OPTION] FILE
Options:
- Search:
-s or --search Search for keyword(s) in file names and inside file text
-st or --searchtitle Search for keyword(s) in file names
-sc or --searchcontent Search for keyword(s) inside file text
-l or -- list List all notes
- Add and edit:
-a or --add Add a text file to the tnote note directory
-e or --edit Edit a tnote note, using the default editor
-r or --rename Rename a note
-d or --delete Delete a note
- Misc:
-h or --help Display the help
-v or --version List version and author info
Examples:
tnote foo List all notes with 'foo' in the filename; if there
is only one result, it will be displayed
tnote -s foo Search all notes with 'foo' in the title or content
tnote -st bar Search all notes with 'bar' in the filename
tnote -sc foo bar Search all notes with 'foo' or 'bar' in the content
tnote -a foo Create a note with the title 'foo'
tnote -a Create a note with a dialog for the name (interactive mode)
There are a few useful variables for people who use this script a lot:
DEFAULT_TNOTE_DIR, TNOTEPATH, and TNOTE_TEXT_VIEWER.
DEFAULT_TNOTE_DIR is the directory in which tnote notes are stored by
default. This is set to $HOME/.tnote if left unspecified by the user.
TNOTEPATH is similar to the PATH variable, except it's used for tnote
notes. If you're referencing tnote notes from multiple directories,
you'll want to make use of this environment variable. If this variable is
not set by the user, it's populated by DEFAULT_TNOTE_DIR. If the user does
set this variable, it's up to them to include every directory in which tnote
notes are kept, as DEFAULT_TNOTE_DIR is not automatically added to the
TNOTEPATH variable.
TNOTE_TEXT_VIEWER is the program used to view the normal tnote notes. It's
assumed to accept text from stdin ('cat' and 'less' are good options).
'cat' is used by default.
5. Who made it?
This version: Florian Poeck
https://github.com/yafp
Main version: James Hendrie
hendrie.james@gmail.com
https://github.com/jahendrie