diff --git a/.local/bin/encfsw b/.local/bin/encfsw index 87e9b165..43decf36 100755 --- a/.local/bin/encfsw +++ b/.local/bin/encfsw @@ -21,14 +21,18 @@ check() { done } +## REVIEW: Only set extpass if no PTY is connected? +if [ -z "$SUDO_ASKPASS" ] && command -v emacs-askpass >/dev/null 2>&1; then + SUDO_ASKPASS=emacs-askpass +fi + mount() { check realpath encfs SOURCE="$(realpath "$1")" MOUNTPOINT="${SOURCE}_decrypted" mkdir -p "$MOUNTPOINT" if [ -z "$PASS" ]; then - ## REVIEW: Only set extpass if no PTY is connected? - encfs --extpass=$(which lxqt-openssh-askpass 2>/dev/null) "$SOURCE" "$MOUNTPOINT" || rmdir "$MOUNTPOINT" + encfs --extpass="$SUDO_ASKPASS" "$SOURCE" "$MOUNTPOINT" || rmdir "$MOUNTPOINT" else echo "$PASS" | encfs --stdinpass "$SOURCE" "$MOUNTPOINT" || rmdir "$MOUNTPOINT" fi diff --git a/.package-lists/guix-common-lisp-manifest.scm b/.package-lists/guix-common-lisp-manifest.scm index bdb38918..5299ef87 100644 --- a/.package-lists/guix-common-lisp-manifest.scm +++ b/.package-lists/guix-common-lisp-manifest.scm @@ -3,8 +3,6 @@ "ccl" ; Useful for portability checks, alternative compilation warnings, etc. "lisp-repl-core-dumper" - "lxqt-openssh-askpass" ; To set SUDO_ASKPASS. - "sbcl-alexandria" "sbcl-bordeaux-threads" "sbcl-calispel" diff --git a/.slynk.lisp b/.slynk.lisp index 8e613448..96441dc2 100644 --- a/.slynk.lisp +++ b/.slynk.lisp @@ -1,6 +1,4 @@ ;; To get "sudo" to work in SLY. -(let ((askpass (format nil - "~a/.guix-extra-profiles/common-lisp/common-lisp/bin/lxqt-openssh-askpass" - (uiop:getenv "HOME")) )) +(let ((askpass (format nil "~a/.local/bin/emacs-askpass" (uiop:getenv "HOME")))) (when (uiop:file-exists-p askpass) (setf (uiop:getenv "SUDO_ASKPASS") askpass)))