From c0f4edd4bd3bfe918e982d7285020c0a1d5b7256 Mon Sep 17 00:00:00 2001 From: Asara Date: Sat, 4 Jan 2025 17:54:15 -0500 Subject: [PATCH] move j to subdir based on month --- .bashrc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.bashrc b/.bashrc index dd26f76..4300d1f 100644 --- a/.bashrc +++ b/.bashrc @@ -52,5 +52,9 @@ bash ~/.motd # quick writing funcs function unlock() { export SOPS_AGE_KEY=$(age -d ${HOME}/.age/privkey.age); } function write() { SOPS_AGE_KEY=${SOPS_AGE_KEY} EDITOR='vim -c "Goyo"' sops $1; } -function j() { SOPS_AGE_KEY=${SOPS_AGE_KEY} EDITOR='vim -c "Goyo"' sops ${HOME}/journal/$(date +%Y%m%d).txt; } +function j() { + JDIR=${HOME}/journal/$(date +%Y%m)/ + mkdir -p ${JDIR} + SOPS_AGE_KEY=${SOPS_AGE_KEY} EDITOR='vim -c "Goyo"' sops ${JDIR}/$(date +%d).txt +} function lock() { unset SOPS_AGE_KEY; }