1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # 30_env.ax-io: Setup environment
5 if [[ -z "$TZ" && -r "/etc/timezone" ]]; then
6 TZ=$(<"/etc/timezone") export TZ
9 # Setup XDG cache directory
10 if [[ -z "$XDG_CACHE_HOME" ]]; then
11 XDG_CACHE_HOME="$LOCAL_HOME/.cache"
13 if [[ ! -d "$XDG_CACHE_HOME" ]]; then
14 mkdir -p "$XDG_CACHE_HOME"
15 chmod 0700 "$XDG_CACHE_HOME"
19 # Setup XDG runtime directory
20 if [[ -z "$XDG_RUNTIME_DIR" ]]; then
21 XDG_RUNTIME_DIR="${TMPDIR:-/tmp/${UID}-runtime-dir}"
23 if [[ ! -d "$XDG_RUNTIME_DIR" ]]; then
24 mkdir -p "$XDG_RUNTIME_DIR"
25 chmod 0700 "$XDG_RUNTIME_DIR"
27 export XDG_RUNTIME_DIR
29 # Setup ZSH cache directory
30 if [[ -z "$ZSH_CACHE_DIR" ]]; then
31 ZSH_CACHE_DIR="$XDG_CACHE_HOME/zsh"
33 if [[ ! -d "$ZSH_CACHE_DIR" ]]; then
34 mkdir -p "$ZSH_CACHE_DIR"
35 chmod 0700 "$ZSH_CACHE_DIR"