From 5791e8bb045c20cb7d4063d890bbddb1ba19739e Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Tue, 4 Feb 2020 13:19:36 +0100 Subject: [PATCH] contrib describe_sessions: Look for sessions in XDG_RUNTIME_DIR The sessions are stored in `$XDG_RUNTIME_DIR` when that variable is defined. --- contrib/describe_sessions.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/describe_sessions.sh b/contrib/describe_sessions.sh index d89e1a47..e66e016f 100755 --- a/contrib/describe_sessions.sh +++ b/contrib/describe_sessions.sh @@ -40,7 +40,12 @@ main() { script=$(printf 'nop %%sh{ %s }' "${KAK_SCRIPT}" | sed "s,{{outfile}},\"${outfile}\",g") - for session in "${TMPDIR:-/tmp}/kakoune/${USER}"/*; do + sessions_dir="${TMPDIR:-/tmp}/kakoune/${USER}" + if [ -n "${XDG_RUNTIME_DIR}" ]; then + sessions_dir="${XDG_RUNTIME_DIR}/kakoune" + fi + + for session in "${sessions_dir}"/*; do name_session="${session##*/}" if printf '' | socat - UNIX-CONNECT:"${session}",connect-timeout=1 2>/dev/null; then