histd/readme.md

75 lines
1.5 KiB
Markdown

# How I spent this day
A simple but useful personal diary application.
The sole purpose of this application is to quickly create a file
and open it in a text editor so that I can take a note before I lose my desire.
Notes can be found in the `~/.local/share/histd` directory.
```sh
tree ~/.local/share/histd
# /home/user/.local/share/histd
# └── 2022
# └── 08
# ├── 18.md
# └── 19.md
```
## Usage
Mark this script as executable:
```bash
chmod +x histd.sh
```
Now you can create your first note:
```bash
./histd.sh
```
This command can be run as many times as you want, it will open the same file until the day is over.
You can open the last note with the command:
```bash
./histd.sh last
```
## Editor configuration
When opening a text editor, the program checks the value of the `EDITOR` environment variable.
If you want to use a different editor, edit the `~/.bashrc` file (if you are using bash):
```bash
export EDITOR=nano
```
Don't forget to start a new session or execute the following command:
```bash
source ~/.bashrc
```
## Backup
To create an archive of all notes, run the following command:
```bash
./histd.sh backup
```
Required programs: `tar`, `xz`.
## Merge all notes
This command concatenates all files and prefixes each with the filename.
```bash
./histd.sh merge
```
## List all notes
```bash
./histd.sh list
# /home/user/.local/share/histd
# └── 2022
# └── 08
# ├── 18.md
# └── 19.md
```
Required programs: `tree`.