From f9df24591f2fd926594d3066259cea2648fd135d Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Mon, 29 Jul 2024 19:59:39 +0300 Subject: emacs: notmuch: Add func to decrypt notmuch script hook. --- .config/emacs/init.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to '.config/emacs/init.el') diff --git a/.config/emacs/init.el b/.config/emacs/init.el index 6856bce..2d341a0 100644 --- a/.config/emacs/init.el +++ b/.config/emacs/init.el @@ -1016,6 +1016,13 @@ By default, returns all jabber related buffers format." :hook ((notmuch-hello-mode . (lambda () (display-line-numbers-mode 0))) (notmuch-search-mode . (lambda () (display-line-numbers-mode 0) (emojify-mode)))) :config + (defun thanos/notmuch-decrypt-script () + (let ((encrypted-script (expand-file-name "notmuch-hook.sh.gpg" "~/.scripts")) + (script (expand-file-name "notmuch-hook.sh" "~/.scripts"))) + (unless (file-exists-p script) + (epa-decrypt-file encrypted-script script) + (set-file-modes script #o700)))) + (defun thanos/notmuch-update () (interactive) (let ((default-directory "~/") @@ -1025,6 +1032,7 @@ By default, returns all jabber related buffers format." (split-window-vertically (- height)) (other-window 1) (switch-to-buffer new-buffer) + (thanos/notmuch-decrypt-script) (let ((proc (async-shell-command command new-buffer))) (set-process-sentinel (get-buffer-process new-buffer) -- cgit v1.2.3