]> arthur.barton.de Git - ax-zsh.git/blob - core/30_env/30_env.zprofile
653d82e996275f1a60749eafa26beea175a6a361
[ax-zsh.git] / core / 30_env / 30_env.zprofile
1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # 30_env.zprofile: Setup environment
3
4 # Setup time zone
5 if [[ -z "$TZ" && -r "/etc/timezone" ]]; then
6         TZ=$(<"/etc/timezone") export TZ
7 fi
8
9 # Setup XDG cache directory
10 if [[ -z "$XDG_CACHE_HOME" ]]; then
11         XDG_CACHE_HOME="$LOCAL_HOME/.cache"
12         mkdir -p "$XDG_CACHE_HOME"
13         chmod 0700 "$XDG_CACHE_HOME"
14 fi
15 export XDG_CACHE_HOME
16
17 # Setup XDG runtime directory
18 if [[ -z "$XDG_RUNTIME_DIR" ]]; then
19         XDG_RUNTIME_DIR="${TMPDIR:-/tmp/${UID}-runtime-dir}"
20         mkdir -p "$XDG_RUNTIME_DIR"
21         chmod 0700 "$XDG_RUNTIME_DIR"
22 fi
23 export XDG_RUNTIME_DIR
24
25 # Setup ZSH cache directory
26 if [[ -z "$ZSH_CACHE_DIR" ]]; then
27         ZSH_CACHE_DIR="$XDG_CACHE_HOME/zsh"
28         mkdir -p "$ZSH_CACHE_DIR"
29         chmod 0700 "$ZSH_CACHE_DIR"
30 fi
31 export ZSH_CACHE_DIR