dotfiles

config files and scripts at HOME.
git clone git://git.ricketyspace.net/dotfiles.git
Log | Files | Refs

commit e84c3c5d76b7d934f5798f3c75bb731c4e3b9a98
parent 895cb82f14d37a5a568f4bdfa05a5e8c2413e5cb
Author: rsiddharth <s@ricketyspace.net>
Date:   Mon,  2 Apr 2018 23:28:21 +0000

.emacs.d/elisp/rsd-gpg.el: Provide rsd-gpg.

Diffstat:
.emacs.d/elisp/rsd-gpg.el | 30++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+), 0 deletions(-)

diff --git a/.emacs.d/elisp/rsd-gpg.el b/.emacs.d/elisp/rsd-gpg.el @@ -0,0 +1,30 @@ +;; rsd-gpg.el -- setup gpg agent environment variables. +;; +;; Copyright © 2018 rsiddharth <s@ricketyspace.net> +;; +;; This program is free software: you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation, either version 3 of the +;; License, or (at your option) any later version. +;; +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. +;; +;; Full text of the GNU General Public License is available at +;; <https://gnu.org/licenses/gpl.html>. + +(defun rsd/gpg-refresh-environment () + "Set gpg-agent environment variables." + (interactive) + (let ((gset (lambda (p) + (setenv (car p) + (string-trim + (shell-command-to-string + (concat "gpgconf --list-dirs " (cdr p))))))) + (env-vars '(("SSH_AUTH_SOCK" . "agent-ssh-socket") + ("GPG_AGENT_INFO" . "agent-socket")))) + (if (executable-find "gpgconf") (map nil gset env-vars)))) + +(provide 'rsd-gpg)