~sotirisp/today

today: Add TODAY_CAT variable for decryption v1 NEEDS REVISION

Ángel Castañeda: 1
 Add TODAY_CAT variable for decryption

 2 files changed, 6 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sotirisp/today/patches/51690/mbox | git am -3
Learn more about email & git

[PATCH today] Add TODAY_CAT variable for decryption Export this patch

---
all the other variables let you have an encrypted diary, but I had to
manually change the `cat` to `gpg -dq` to have `today log` work.
 doc/today.1.scd | 6 +++++-
 today           | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/doc/today.1.scd b/doc/today.1.scd
index 0e08255..148ad6a 100644
--- a/doc/today.1.scd
+++ b/doc/today.1.scd
@@ -61,6 +61,10 @@ appropriate environment variables.
	The suffix added after the date in journal filenames. Defaults to *.md*
	if unset.

*TODAY_CAT*
	The command used to display each journal entry for *today* *log*. Useful
	for decrypting encrypted files. Defaults to *cat(1)* if unset.

*TODAY_CMD*
	The command used to edit a journal file. It is passed to *eval*(1). In
	addition to any environment variables, the following variables can be
@@ -94,7 +98,7 @@ patches can be submitted by email to ~sotirisp/today@lists.sr.ht.

# SEE ALSO

*eval*(1), *grep*(1), *more*(1), *vi*(1)
*cat*(1), *eval*(1), *grep*(1), *more*(1), *vi*(1)

; SPDX-FileCopyrightText: 2020-2023 Sotiris Papatheodorou
; SPDX-License-Identifier: GPL-3.0-or-later
diff --git a/today b/today
index ae4b90a..2f5219f 100755
--- a/today
+++ b/today
@@ -144,7 +144,7 @@ view_files() (
	journal_files | sort $sort_args | while IFS= read -r f
	do
		printf '%s\n\n' "$(basename "$f" "$TODAY_SUFFIX")"
		cat "$f"
		${TODAY_CAT:-cat} "$f"
		printf '\n\n\n'
	done | pager_if_terminal
)
-- 
2.45.0
Thanks for the patch Ángel!

May I suggest renaming the environment variable to TODAY_OPEN to make 
the name similar to the LESSOPEN variable used for the less 
preprocessor. Looks good otherwise.

Sotiris

On 2