From 92e185b8881ff3fc2cb81c9eaf544528397286b5 Mon Sep 17 00:00:00 2001 From: Anjandev Momi Date: Mon, 13 Jul 2020 18:12:06 -0700 Subject: [PATCH] Add XDG user directories and env variables This patch adds the rest of XDG user directories as per XDG base directory specification. https://wiki.archlinux.org/index.php/XDG_Base_Directory This fixes launching anbox on sxmo. Furthermore, it makes sure $XDG_RUNTIME_HOME has the correct permissions. Signed-off-by: Miles Alan --- scripts/core/sxmo_xinit.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/core/sxmo_xinit.sh b/scripts/core/sxmo_xinit.sh index 3a061d4..ea478af 100755 --- a/scripts/core/sxmo_xinit.sh +++ b/scripts/core/sxmo_xinit.sh @@ -8,6 +8,15 @@ envvars() { command -v "$EDITOR" || export EDITOR=vis [ -z "$MOZ_USE_XINPUT2" ] && export MOZ_USE_XINPUT2=1 [ -z "$XDG_CONFIG_HOME" ] && export XDG_CONFIG_HOME=~/.config + [ -z "$XDG_CACHE_HOME" ] && export XDG_CACHE_HOME=~/.cache + [ -z "$XDG_DATA_HOME" ] && export XDG_DATA_HOME=~/.local/share + [ -z "$XDG_RUNTIME_HOME" ] && export XDG_RUNTIME_HOME=~/.local/run +} + +setupxdgruntimedir() { + mkdir -p $XDG_RUNTIME_HOME + chmod 700 $XDG_RUNTIME_HOME + chown "$USER:$USER" "$XDG_RUNTIME_HOME" } xdefaults() { @@ -54,6 +63,7 @@ startdwm() { xinit() { envvars + setupxdgruntimedir xdefaults daemons startdwm