From e94b1f96a4b1c4e47e9896cca86c60bab6bf13d3 Mon Sep 17 00:00:00 2001 From: Sheppy Date: Thu, 11 May 2017 14:10:13 +0200 Subject: [PATCH] Fixed SSH-Agent startup and keyaddding --- herbstluftwm/autostart | 7 ++++++- zshrc | 12 ++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/herbstluftwm/autostart b/herbstluftwm/autostart index 57779a1..8b4dbb4 100755 --- a/herbstluftwm/autostart +++ b/herbstluftwm/autostart @@ -14,12 +14,17 @@ xsetroot -solid '#5A8E3A' hc keyunbind --all pkill dunst pkill xautolock -pkill -s 15 hl_pracct #send SIGTERM for correct termination during write +pkill -s 15 hl_pracct #send SIGTERM for correct termination during write +pkill ssh-agent #correctly terminate the current agent #variables Mod=Mod4 # Use the super key as the main modifier ######### MACHINE SPECIFIC SETUP ######### +### All Machines #### +if [ -f $HOME/.config/agent_socket ]; then + eval `ssh-agent -a /tmp/ssh-$(cat $HOME/.config/agent_socket)` +fi ### Atlantis PC-specific setup ### if [[ "$HOST" == "atlantispc" ]]; then hc detect_monitors diff --git a/zshrc b/zshrc index 7183d47..ccf9967 100644 --- a/zshrc +++ b/zshrc @@ -48,6 +48,11 @@ bindkey '^R' history-incremental-pattern-search-backward zmodload zsh/complist #bessere listen autoload -Uz compinit; compinit #completioni +### SSH-AGENT ### +if [ -f $HOME/.config/agent_socket ]; then + export SSH_AUTH_SOCK=/tmp/ssh-$(cat $HOME/.config/agent_socket) +fi + ### UMASK ### umask 077 @@ -195,12 +200,7 @@ alias l="ls -lh --color=auto" ## SSH-KEYS ## gitssh=~/.ssh/gitrsa -function key(){ - if [[ -z $SSH_AUTH_SOCK ]]; then - eval `ssh-agent` - fi - ssh-add $gitssh -} +ssh-add $gitssh ## ROOT ## alias udev_reload="udevadm control --reload-rules && udevadm trigger" #reload all udevrules on the fly