[zsh] Convert zprofile to do_init_functions
This commit is contained in:
parent
20414bb31c
commit
edf8034308
2 changed files with 14 additions and 21 deletions
27
zprofile
27
zprofile
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue