[zsh] Convert zprofile to do_init_functions

This commit is contained in:
Eryn Wells 2022-05-25 14:37:29 -07:00
parent 20414bb31c
commit edf8034308
2 changed files with 14 additions and 21 deletions

View file

@ -1,26 +1,11 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
# Start SSH agent for password-less logins
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
if ! pgrep -u $USER ssh-agent 1>/dev/null; then
eval $(ssh-agent -s > ~/.ssh_agent_vars)
trap "kill $SSH_AGENT_PID" 0
else
eval $(cat ~/.ssh_agent_vars)
fi
fi
zsh_init_profile_functions=( \
connect_ssh_agent \
init_profile_$SYS \
list_tmux_sessions \
)
autoload -Uz list_tmux_sessions
autoload -Uz binary_exists
do_init_functions zsh_init_profile_functions
if binary_exists sw_vers && binary_exists lolcat; then
case $SYS in
darwin)
print "It's `date +'%H:%M on %A, %B %d'`.\nThis machine is a $HWMODEL.\nYou're running macOS $OSVERSION.\n" | lolcat
;;
*) ;;
esac
fi
list_tmux_sessions