diff --git a/.config/zsh/.zlogout b/.config/zsh/.zlogout new file mode 100644 index 0000000..002ff41 --- /dev/null +++ b/.config/zsh/.zlogout @@ -0,0 +1 @@ +[[ -z $SSH_AGENT_PID ]] || kill "$SSH_AGENT_PID" diff --git a/.config/zsh/.zprofile b/.config/zsh/.zprofile index d093191..64449c6 100644 --- a/.config/zsh/.zprofile +++ b/.config/zsh/.zprofile @@ -94,4 +94,8 @@ if (( $+commands[dircolors] )); then fi # Automatically start X on login after boot. -[[ -n $DISPLAY || $XDG_VTNR -ne 1 ]] || exec startx +# Do not use exec so that the zlogout is still read. +if command -v startx &>/dev/null && [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]]; then + startx + exit $? +fi