summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gpg-agent.conf10
-rw-r--r--install.conf.yaml1
-rw-r--r--omz/custom/func.zsh3
-rw-r--r--zshrc7
4 files changed, 20 insertions, 1 deletions
diff --git a/gpg-agent.conf b/gpg-agent.conf
new file mode 100644
index 0000000..40fb8ac
--- /dev/null
+++ b/gpg-agent.conf
@@ -0,0 +1,10 @@
+# https://github.com/drduh/config/blob/master/gpg-agent.conf
+# https://www.gnupg.org/documentation/manuals/gnupg/Agent-Options.html
+enable-ssh-support
+default-cache-ttl 60
+max-cache-ttl 120
+#pinentry-program /usr/bin/pinentry-curses
+#pinentry-program /usr/bin/pinentry-tty
+#pinentry-program /usr/bin/pinentry-x11
+pinentry-program /usr/local/bin/pinentry-curses
+#pinentry-program /usr/local/bin/pinentry-mac
diff --git a/install.conf.yaml b/install.conf.yaml
index 6228e26..93204a6 100644
--- a/install.conf.yaml
+++ b/install.conf.yaml
@@ -23,6 +23,7 @@
path: omz/custom
create: true
force: true
+ ~/.gnupg/gpg-agent.conf: gpg-agent.conf
- shell:
- [git submodule update --init --recursive, Installing submodules]
diff --git a/omz/custom/func.zsh b/omz/custom/func.zsh
index 7079e23..7735829 100644
--- a/omz/custom/func.zsh
+++ b/omz/custom/func.zsh
@@ -1,3 +1,4 @@
function rh {
- rm ~/.zsh_history
+ rm ~/.zsh_history
+ exec zsh
}
diff --git a/zshrc b/zshrc
index 9add5a4..cdb48d2 100644
--- a/zshrc
+++ b/zshrc
@@ -91,6 +91,13 @@ source $ZSH/oh-my-zsh.sh
ZSH_COMPDUMP=~/.cache/.zcompdump
+export GPG_TTY="$(tty)"
+export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
+gpgconf --kill gpg-agent
+gpgconf --launch gpg-agent
+gpg-connect-agent updatestartuptty /bye > /dev/null
+gpg-connect-agent "scd serialno" "learn --force" /bye > /dev/null
+
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.