-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy path.zshenv
56 lines (44 loc) · 2.08 KB
/
.zshenv
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
#!/usr/bin/env zsh
## Dotfiles and templates
command mkdir -p "${HOME-}"'/Dropbox/dotfiles' &&
export DOTFILES="${DOTFILES:="${HOME-}"/Dropbox/dotfiles}" &&
command mkdir -p "${TEMPLATE:="${DOTFILES-}"/../Template}" &&
export TEMPLATE="${TEMPLATE:="${DOTFILES-}"/../Template}" &&
command mkdir -p "${DEFAULT:="${TEMPLATE-}"/../Default}" &&
export DEFAULT="${DEFAULT:="${TEMPLATE-}"/../Default}"
## XDG
# https://specifications.freedesktop.org/basedir-spec/0.7/ar01s03.html
export XDG_DATA_HOME="${XDG_DATA_HOME:="${HOME-}"/.local/share}"
export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:="${HOME-}"/.config}"
export XDG_STATE_HOME="${XDG_STATE_HOME:="${HOME-}"/.local/state}"
# `XDG_DATA_DIRS` does have trailing slashes
# https://web.archive.org/web/0id_/lists.freedesktop.org/archives/xdg/2019-June/014157.html
export XDG_DATA_DIRS="${XDG_DATA_DIRS:=/usr/local/share/:/usr/share/}"
export XDG_CONFIG_DIRS="${XDG_CONFIG_DIRS:=/etc/xdg}"
export XDG_CACHE_HOME="${XDG_CACHE_HOME:="${HOME-}"/.cache}"
# `XDG_RUNTIME_DIR` has no default and requires `700` permissions
command mkdir -p "${TMPDIR:-/tmp}"'/xdg_runtime_dir-'"$(command id -n -u)" &&
command chmod 700 "${TMPDIR:-/tmp}"'/xdg_runtime_dir-'"$(command id -n -u)" &&
export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:="${TMPDIR:-/tmp}"/xdg_runtime_dir-"$(command id -n -u)"}"
## Go
# https://github.com/golang/go/wiki/SettingGOPATH/450fad957455a745f8d97ad4cb79376cd689810a
# command go env -w GOPATH="${HOME-}"'/.go' ||
export GOPATH="${GOPATH:="${HOME-}"/.go}"
## Internal Field Separators
# https://unix.stackexchange.com/a/220658
# https://opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_05_03
IFS="$(printf ' \t\n|')"
export IFS="${IFS%|}"
## Locale
export LC_ALL="${LC_ALL:=en_US.UTF-8}"
export TZ="${TZ:=America/New_York}"
## POSIX
# https://askubuntu.com/a/1121665
# set to `1` to activate debugging
export POSIXLY_CORRECT="${POSIXLY_CORRECT:-0}"
## Rust
# https://github.com/mkrasnitski/git-power-rs/tree/2fc2906#installing
export CARGO_HOME="${CARGO_HOME:="${HOME-}"/.cargo}"
## private
test -r "${HOME-}"'/.env' &&
. "${HOME-}"'/.env'