config

OpenBSD system configuration
git clone git://jacobedwards.org/config
Log | Files | Refs | README

commit 0070b280556939d625b11491cdbc52694ee045ab
parent c12944480b8b10ff31ad7db50532567f00c04f45
Author: Jacob R. Edwards <n/a>
Date:   Sat,  3 Sep 2022 10:41:37 -0700

Add resume script to interprete and use resume files

The resume file format is something that naturally formed when
keeping track of my page in books, and this script uses that
information to quickly resume reading.

Diffstat:
Alocal/bin/bin/resume | 28++++++++++++++++++++++++++++
1 file changed, 28 insertions(+), 0 deletions(-)

diff --git a/local/bin/bin/resume b/local/bin/bin/resume @@ -0,0 +1,28 @@ +#!/bin/sh +# Copyright 2022 Jacob R. Edwards +# Resume reading a book using a page index +# +# Page index are of the form: +# path/to/book # location information +# I use p$n [ex. p5 for page 5] for my location information, so +# it's safest to use the same format in case I decide to do something +# other than just display the information. An example of this: +# classics/author/book.pdf # p95 + +book="$1" +export book +file="${2:-$HOME/books/resume}" +export file + +if test $# -lt 1 +then + cat < "$file" +else + base="$(dirname "$file")" + export base + awk -F ' +# +' ' + match($1, ENVIRON["book"]) { + system("mupdf " ENVIRON["base"] "/" $1 " &") + system("herbe " $2 " &") + }' < "$file" +fi