From e7e9f67e721c2dc4f3943cd670ab42cbe016a282 Mon Sep 17 00:00:00 2001 From: Ian Mancini Date: Thu, 12 Mar 2020 12:30:14 -0300 Subject: [PATCH] Don't ask for ssh passphrase on TTY --- template/bash/.bashrc | 6 +++++- template/zsh/.zshrc | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/template/bash/.bashrc b/template/bash/.bashrc index 7153ab6..e289872 100755 --- a/template/bash/.bashrc +++ b/template/bash/.bashrc @@ -21,7 +21,11 @@ export FZF_DEFAULT_COMMAND='ag -g ""' export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" # Keychain -eval "$(keychain --quiet --eval --agents gpg,ssh id_rsa)" +if [ -z ${DISPLAY+x} ]; then + eval "$(keychain --eval --quiet --noask --agents gpg,ssh id_rsa)" +else + eval "$(keychain --eval --quiet --agents gpg,ssh id_rsa)" +fi # load Aliases [ -f "$HOME/.aliasrc" ] && source "$HOME/.aliasrc" diff --git a/template/zsh/.zshrc b/template/zsh/.zshrc index 753875d..fcbd71c 100755 --- a/template/zsh/.zshrc +++ b/template/zsh/.zshrc @@ -32,6 +32,7 @@ zplug "zsh-users/zsh-autosuggestions" zplug "zsh-users/zsh-history-substring-search" zplug "zsh-users/zsh-completions" zplug "laurenkt/zsh-vimto" +zplug "MichaelAquilina/zsh-autoswitch-virtualenv" # zplug "paulmelnikow/zsh-startup-timer" # zplug "lib/nvm", from:oh-my-zsh @@ -130,11 +131,15 @@ bindkey '^[[B' history-substring-search-down export PATH=/home/ianmethyst/.local/bin:$PATH # fzf -export FZF_DEFAULT_COMMAND='ag -g ""' +export FZF_DEFAULT_COMMAND='ag --hidden -g ""' export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" # Keychain -eval "$(keychain --eval --quiet --agents gpg,ssh id_rsa)" +if [ -z ${DISPLAY+x} ]; then + eval "$(keychain --eval --quiet --noask --agents gpg,ssh id_rsa)" +else + eval "$(keychain --eval --quiet --agents gpg,ssh id_rsa)" +fi # fnm export PATH=/home/ianmethyst/.fnm:$PATH