From 9a6e56773898199cae4b858387744f6ca4e6d414 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Wed, 31 Aug 2022 15:40:04 +0100 Subject: [PATCH] Set XDG_RUNTIME_DIR if needed --- roles/home-cli/files/profile | 1 + roles/home-cli/files/shrc | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/roles/home-cli/files/profile b/roles/home-cli/files/profile index e3fc8cf..4c29707 100644 --- a/roles/home-cli/files/profile +++ b/roles/home-cli/files/profile @@ -27,6 +27,7 @@ export XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}" export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" export XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" export XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}" +export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/tmp/.runtime-$(id -un)}" # Locale and language. ## Clear the existing locale settings and set options I always want. diff --git a/roles/home-cli/files/shrc b/roles/home-cli/files/shrc index aa32c53..b937385 100644 --- a/roles/home-cli/files/shrc +++ b/roles/home-cli/files/shrc @@ -39,6 +39,7 @@ if [ ! -d "$XDG_DATA_HOME" ] ; then install -d -m 0700 "$XDG_DATA_HOME" ; fi if [ ! -d "$XDG_CACHE_HOME" ] ; then install -d -m 0700 "$XDG_CACHE_HOME" ; fi if [ ! -d "$XDG_CONFIG_HOME" ] ; then install -d -m 0700 "$XDG_CONFIG_HOME" ; fi if [ ! -d "$XDG_STATE_HOME" ] ; then install -d -m 0700 "$XDG_STATE_HOME" ; fi +if [ ! -d "$XDG_RUNTIME_DIR" ] ; then install -d -m 0700 "$XDG_RUNTIME_DIR" ; fi if [ ! -d "$HOME/.local/bin" ] ; then install -d -m 0700 "$HOME/.local/bin" ; fi _acp_add_path () { @@ -162,8 +163,8 @@ alias pruncerts='prun --volume /etc/pki/ca-trust:/etc/pki/ca-trust:ro --volume / if command -v ssh-agent > /dev/null then - export SSH_AUTH_SOCK="${SSH_AUTH_SOCK:-$XDG_STATE_HOME/ssh-agent.socket}" - export SSH_AGENT_PID="${SSH_AGENT_PID:-$XDG_STATE_HOME/ssh-agent.pid}" + export SSH_AUTH_SOCK="${SSH_AUTH_SOCK:-$XDG_RUNTIME_DIR/ssh-agent.socket}" + export SSH_AGENT_PID="${SSH_AGENT_PID:-$XDG_RUNTIME_DIR/ssh-agent.pid}" if [ ! -S "$SSH_AUTH_SOCK" ] then ssh-agent -a "$SSH_AUTH_SOCK" > /dev/null