dotfiles

My collection of dotfiles
git clone git://git.noxz.tech/dotfiles
Log | Files | Refs

commit 257a00474dc160d991753cfc4de9005f7b765b5f
parent 1f30d4b84371008fa75e850d5dfb232bdb88cd7d
Author: Chris Noxz <chris@noxz.tech>
Date:   Tue, 29 Oct 2019 19:56:03 +0100

[ksh] Complete XDG setup in .profile

Diffstat:
Mksh/.profile | 15++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/ksh/.profile b/ksh/.profile @@ -2,9 +2,18 @@ [ -f "$HOME/.kshrc" ] && export ENV="$HOME/.kshrc" # setup XDG -export XDG_CONFIG_HOME="$HOME/.config" -export XDG_CACHE_HOME="$HOME/.cache" -export XDG_DATA_HOME="$HOME/.local/share" +test -z "$XDG_DATA_HOME" && export XDG_DATA_HOME="$HOME/.local/share" +test -z "$XDG_CONFIG_HOME" && export XDG_CONFIG_HOME="$HOME/.config" +test -z "$XDG_DATA_DIRS" && export XDG_DATA_DIRS="/usr/local/share/:/usr/share/" +test -z "$XDG_CONFIG_DIRS" && export XDG_CONFIG_DIRS="/etc/xdg" +test -z "$XDG_CACHE_HOME" && export XDG_CACHE_HOME="$HOME/.cache" +test -z "$XDG_RUNTIME_DIR" && export XDG_RUNTIME_DIR="/tmp/${UID}-runtime-dir" + +# create XDG_RUNTIME_DIR if non-existent +if ! test -d "${XDG_RUNTIME_DIR}"; then + mkdir "${XDG_RUNTIME_DIR}" + chmod 0700 "${XDG_RUNTIME_DIR}" +fi # add local paths export PATH="$PATH:$HOME/.bin:/xtra/bin"