]>
Commit | Line | Data |
---|---|---|
d569f3f7 | 1 | ### exports for new non-interactive shell |
2 | if [[ $SHLVL == 1 ]] { | |
3 | ## lang | |
4 | export CHARSET=UTF-8 | |
5 | export LANG="en_US.UTF-8" | |
6 | export LC_CTYPE="$LANG" | |
7 | ||
8 | ## path | |
9 | # /usr/{pkg,local,games} are unix/bsdisms | |
10 | typeset -U PATH path | |
11 | path=({~/,/,/usr/}sbin {~/,/,/usr/}bin /usr/pkg/{s,}bin /usr/X11R{7,6}/bin | |
12 | /usr/local/{s,}bin /usr/games "${path[@]}") | |
13 | export PATH | |
14 | typeset -U _sev_backup_path | |
15 | _sev_backup_path=("${path[@]}") | |
16 | typeset -U FPATH fpath | |
17 | fpath=(${ZDOTDIR:-$HOME/.zsh}/functions/{*,Completions/*}(N) "${fpath[@]}") | |
18 | export FPATH | |
19 | ||
20 | ## xdg | |
21 | export XDG_CONFIG_HOME=~/etc | |
22 | export XDG_CONFIG_DIRS=~/.config:/usr/pkg/etc/xdg:/usr/local/etc/xdg:/etc/xdg | |
23 | export XDG_DATA_HOME=~/share | |
24 | export XDG_DATA_DIRS=~/.local/share:/usr/pkg/share:/usr/local/share:/usr/share | |
25 | export XDG_CACHE_HOME=~/tmp | |
26 | export XDG_RUNTIME_DIR=~/tmp | |
27 | ||
28 | # create tmp link | |
29 | t="${TMPDIR:-/tmp}/home-$LOGNAME" | |
30 | h="$HOME/tmp" | |
31 | if [[ ! -e "$t" ]] { | |
32 | mkdir -m 700 "$t" > /dev/null 2>&1 | |
33 | # TODO: check if dir exists after mkdir | |
34 | } | |
35 | # allow opaque entries to override link creation | |
36 | if [[ ! -e "$h" ]] { | |
37 | ln -sf "$t" "$h" > /dev/null 2>&1 | |
38 | } | |
39 | unset t h | |
40 | } | |
41 | ||
42 | ### gpg ssh forwarding | |
43 | # these env vars are used as arguments to RemoteForward in ~/.ssh/config | |
44 | if [[ -v commands[gpgconf] && ! ( -v _GNUPG_SOCK_SRC && -v _GNUPG_SOCK_DEST ) ]] { | |
45 | # if already connected over SSH, reuse forwarded socket for future | |
46 | # connections; else use extra socket | |
47 | sock=${SSH_CLIENT:+agent-socket} | |
48 | export _GNUPG_SOCK_SRC=$(gpgconf --list-dirs ${sock:-agent-extra-socket}) | |
49 | # XXX: chance of race condition | |
50 | export _GNUPG_SOCK_DEST=/tmp/.gpg-agent-forward | |
51 | unset sock | |
52 | } | |
53 | ||
ff1a2414 | 54 | ### load site-specific |
8eb81f95 | 55 | if [[ -f ~/.zshenv.local ]] { source ~/.zshenv.local } |
56 | ||
57 | # vim: set et sts=4 sw=4 ts=8 tw=79 : |