X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=core%2F30_env%2F30_env.zprofile;h=781a9ecefc88e43b47e63caa286a44a122c091a9;hb=9bcbfa018f35a64151b919e51cdfac6431c63268;hp=bf646f4dffbbdca4f660cf178eea8c3f204b1574;hpb=8cad8bc55df11b43aa0b88ff20ff16ddbc859a51;p=ax-zsh.git diff --git a/core/30_env/30_env.zprofile b/core/30_env/30_env.zprofile index bf646f4..781a9ec 100644 --- a/core/30_env/30_env.zprofile +++ b/core/30_env/30_env.zprofile @@ -1,9 +1,16 @@ # AX-ZSH: Alex' Modular ZSH Configuration # 30_env.zprofile: Setup environment +# Setup time zone +if [[ -z "$TZ" && -r "/etc/timezone" ]]; then + TZ=$(<"/etc/timezone") export TZ +fi + # Setup XDG cache directory if [[ -z "$XDG_CACHE_HOME" ]]; then XDG_CACHE_HOME="$LOCAL_HOME/.cache" +fi +if [[ ! -d "$XDG_CACHE_HOME" ]]; then mkdir -p "$XDG_CACHE_HOME" chmod 0700 "$XDG_CACHE_HOME" fi @@ -12,6 +19,8 @@ export XDG_CACHE_HOME # Setup XDG runtime directory if [[ -z "$XDG_RUNTIME_DIR" ]]; then XDG_RUNTIME_DIR="${TMPDIR:-/tmp/${UID}-runtime-dir}" +fi +if [[ ! -d "$XDG_RUNTIME_DIR" ]]; then mkdir -p "$XDG_RUNTIME_DIR" chmod 0700 "$XDG_RUNTIME_DIR" fi @@ -20,6 +29,8 @@ export XDG_RUNTIME_DIR # Setup ZSH cache directory if [[ -z "$ZSH_CACHE_DIR" ]]; then ZSH_CACHE_DIR="$XDG_CACHE_HOME/zsh" +fi +if [[ ! -d "$ZSH_CACHE_DIR" ]]; then mkdir -p "$ZSH_CACHE_DIR" chmod 0700 "$ZSH_CACHE_DIR" fi