prezto/runcoms/zlogin
2015-08-04 16:17:53 -06:00

62 lines
2 KiB
Bash

# Sourced in login shells after .zshrc
# Commands that should be exectued only in login shells
# Do not set environment variables
# Do not define alias, functions, options, etc.
# Set terminal type
# Execute external commands (fortune, msgs, etc)
# +--------------------+-------+-------+--------+
# | | Inter | Inter | Script |
# | | Login | | |
# +====================+=======+=======+========+
# | /etc/zshenv | A | A | A |
# +--------------------+-------+-------+--------+
# | $ZDOTDIR/.zshenv | B | B | B |
# +--------------------+-------+-------+--------+
# | /etc/zprofile | C | | |
# +--------------------+-------+-------+--------+
# | $ZDOTDIR/.zprofile | D | | |
# +--------------------+-------+-------+--------+
# | /etc/zshrc | E | C | |
# +--------------------+-------+-------+--------+
# | $ZDOTDIR/.zshrc | F | D | |
# +--------------------+-------+-------+--------+
# | /etc/zlogin | G | | |
# +--------------------+-------+-------+--------+
# | $ZDOTDIR/.zlogin | H | | |
# +--------------------+-------+-------+--------+
# Execute code that does not affect the current session in the background.
{
# Compile the completion dump to increase startup speed.
zcompdump="${ZDOTDIR:-$HOME}/.zcompdump"
if [[ -s "$zcompdump" && (! -s "${zcompdump}.zwc" || "$zcompdump" -nt "${zcompdump}.zwc") ]]; then
zcompile "$zcompdump"
fi
} &!
# Print a random, hopefully interesting, adage.
if (( $+commands[fortune] )); then
if [[ -t 0 || -t 1 ]]; then
fortune -s
print
fi
fi
#echo "Last logins:"
#last -5 $USER
#echo
echo "$BASH $BASH_VERSION"
date -u +"%a %e %b %Y %H:%M:%S GMT"
date -u +"%FT%TZ %Y-%jT%TZ %Y-W%W-%wT%TZ"
date +"%FT%T %Y-%jT%T %Y-W%W-%wT%T"
astrodate.py --jd --mjd --suffix --spacing=8
echo
# Setup by subsystem
for f in `find $HOME/Library/Scripts/config -name '*.shlogin'`; do
source "$f"
done