From: Mark Wooding Date: Thu, 23 Jan 2025 14:37:21 +0000 (+0000) Subject: dot/profile: Set `XDG_RUNTIME_DIR' if it looks relevant. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/9326a87fd936ef6d4f4ca492cb667a5b9f28d869?ds=sidebyside dot/profile: Set `XDG_RUNTIME_DIR' if it looks relevant. Without this, later `emacsclient' run from an SSH session can't find the desktop session's Emacs server. --- diff --git a/dot/profile b/dot/profile index 3c3ab08..55047b1 100644 --- a/dot/profile +++ b/dot/profile @@ -79,6 +79,12 @@ case ${SCHROOT_SESSION_ID+t} in t) ;; *) cd "$HOME" ;; esac ## logout hook, so synthesize one here. case ${DT+t} in t) trap "source $HOME/.shell-logout" EXIT; esac +## Set the `runtime' directory. This gets done automatically on a desktop +## login, but not in, say, SSH, which causes anomalies. +if [ -d /run/user ]; then + : ${XDG_RUNTIME_DIR=/run/user/$(id -u)}; export XDG_RUNTIME_DIR +fi + ###-------------------------------------------------------------------------- ### Set some basic paths.