-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzprofile
61 lines (52 loc) · 2.02 KB
/
zprofile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#
# .zprofile
#
# If we are running under XDM, skip the chatty crap.
#
# If we are running on Mac, every shell is a login shell,
# and this is annoying.
if false && [ -z "$XDMRUNNING" -a `uname` != Darwin ]; then
(
echo "/*"
offensive=-a
if [ "$USER" != tjs -o -f /etc/redhat-release ]; then
# fortune -a wimps out on RHEL, don't use it
# (maybe it's fixed by now, I haven't checked in a while.)
# don't run it at work, or as root, either
offensive=
fi
if [ -x /usr/games/fortune ]; then
/usr/games/fortune $offensive
else
# zsh outputs the error on fd 1 (at least on my mac)
fortunate=`which fortune | grep -v 'not found'`
if [ -n "$fortunate" ]; then
"$fortunate" $offensive
else
echo "The fortune cookie was empty."
fi
fi
echo "*/"
)
fi
#
# If we are running under xdm or something, we might already have done this.
# If not, make sure we do it now. (If we are on a Mac, don't, because there is
# voodoo that makes this just do the right thing somewhat magically.)
#
if [ -z "$SSH_AGENT_PID" -a `uname` != "Darwin" ]; then
# Start an ssh-agent but supress its pid output
# (Note that we ONLY do this if we haven't done it. Secretly this script
# is run by my .xsession in the .xsession shell so it gets run even if
# there was no proper login shell, but that script also runs ssh-agent so
# this code doesn't get run.)
exec ssh-agent zsh
#echo "WARNING: could not exec ssh-agent; still in original shell" 1>&2
# lame way; very undesirable, but not confused by trying to start a new
# shell. when this shell exits, the ssh-agent won't, and that means they
# tend to accumulate.
# eval `ssh-agent 2>/dev/null`
fi
# path munging in ~/.zshrc because in today's enlightened world, my GDM system
# can get me to a shell window that never went through a login shell. Better
# to have it in one place.