]> arthur.barton.de Git - ax-zsh.git/blob - core/30_env/30_env.zprofile
80_local_config: Read local profile(s) in "ax-io" stage
[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 fi
13 if [[ ! -d "$XDG_CACHE_HOME" ]]; then
14         mkdir -p "$XDG_CACHE_HOME"
15         chmod 0700 "$XDG_CACHE_HOME"
16 fi
17 export XDG_CACHE_HOME
18
19 # Setup XDG runtime directory
20 if [[ -z "$XDG_RUNTIME_DIR" ]]; then
21         XDG_RUNTIME_DIR="${TMPDIR:-/tmp/${UID}-runtime-dir}"
22 fi
23 if [[ ! -d "$XDG_RUNTIME_DIR" ]]; then
24         mkdir -p "$XDG_RUNTIME_DIR"
25         chmod 0700 "$XDG_RUNTIME_DIR"
26 fi
27 export XDG_RUNTIME_DIR
28
29 # Setup ZSH cache directory
30 if [[ -z "$ZSH_CACHE_DIR" ]]; then
31         ZSH_CACHE_DIR="$XDG_CACHE_HOME/zsh"
32 fi
33 if [[ ! -d "$ZSH_CACHE_DIR" ]]; then
34         mkdir -p "$ZSH_CACHE_DIR"
35         chmod 0700 "$ZSH_CACHE_DIR"
36 fi
37 export ZSH_CACHE_DIR