local/bin/homeinit, homesync: Init and synchronize Eshell history

master
Pierre Neidhardt 2019-02-04 19:14:50 +01:00
parent 537626d63c
commit f3820091f0
3 changed files with 22 additions and 0 deletions

View File

@ -276,6 +276,16 @@ See `eshell' for the numeric prefix ARG."
(add-hook 'eshell-pre-command-hook 'ambrevar/eshell-status-record)
;;; Version and encrypt history.
;; TODO: The following makes EPA always prompt for recipients for some reason. Bug?
;; (make-directory "~/personal/history/" :parents)
;; (setq eshell-history-file-name (expand-file-name "eshell.gpg" "~/personal/history"))
;; (defun ambrevar/fix-local-epa-file-encrypt-to ()
;; (unless (local-variable-p 'epa-file-encrypt-to (current-buffer))
;; (make-local-variable 'epa-file-encrypt-to))
;; (setq epa-file-encrypt-to "mail@ambrevar.xyz"))
;; (add-hook 'eshell-mode-hook 'ambrevar/fix-local-epa-file-encrypt-to)
;; Always save history
(add-hook 'eshell-pre-command-hook 'eshell-save-some-history)

View File

@ -297,6 +297,12 @@ if [ -x ~/.local/bin/updatedb-local ]; then
~/.local/bin/updatedb-local
fi
if [ -f ~/personal/history/eshell.gpg ]; then
section "Shell history"
mkdir -pv ~/.cache/emacs/eshell/
gpg --output ~/.cache/emacs/eshell/history --decrypt ~/personal/history/eshell.gpg
fi
section "Mail"
lnn "$SOURCEDIR/mail/mbsyncrc" "$HOME/.mbsyncrc"
lnn "$SOURCEDIR/mail/authinfo.gpg" "$HOME/.authinfo.gpg"

View File

@ -97,6 +97,12 @@ fi
section "$HOME/.package-lists"
package-lister
if [ -f ~/.cache/emacs/eshell/history ]; then
section "Shell history"
mkdir -pv ~/personal/history/
gpg --output ~/personal/history/eshell.gpg --repicient mail@ambrevar.xyz --encrypt ~/.cache/emacs/eshell/history
fi
project_status() {
local path=$1
local title=$2