Prefer /run/user instead of /var/run/user

This commit is contained in:
Willow Barraco
2023-10-11 17:19:34 +02:00
parent e2f767bde8
commit 38e450902f

View File

@@ -39,10 +39,14 @@ _sxmo_find_runtime_dir() {
return return
fi fi
if [ -d "/var/run/user/$(id -u)" ]; then # Try something existing
printf "/var/run/user/%s" "$(id -u)" for root in /run /var/run; do
path="$root/user/$(id -u)"
if [ -d "$path" ] && [ -w "$path" ]; then
printf %s "$path"
return return
fi fi
done
# Fallback to a shared memory location # Fallback to a shared memory location
printf "/dev/shm/user/%s" "$(id -u)" printf "/dev/shm/user/%s" "$(id -u)"