From c1525eaa60a3dcc9abf214c2afdd47b2c8163952 Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Fri, 3 Jul 2026 09:30:26 +0100 Subject: automatically makes user.USER service for initing XDG_RUNTIME_DIR --- openrc/conf.d/user.template | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 openrc/conf.d/user.template (limited to 'openrc/conf.d/user.template') diff --git a/openrc/conf.d/user.template b/openrc/conf.d/user.template new file mode 100644 index 0000000..2bf637b --- /dev/null +++ b/openrc/conf.d/user.template @@ -0,0 +1,15 @@ +UID="$$(id -u ${USER})" +if test -z "$${XDG_RUNTIME_DIR}"; then + export XDG_RUNTIME_DIR=/tmp/xdg/"$${UID}"-xdg-runtime-dir + if ! test -d "$${XDG_RUNTIME_DIR}"; then + mkdir -p "$${XDG_RUNTIME_DIR}" + chown -R ${USER}:${USER} "$${XDG_RUNTIME_DIR}" + chmod -R 0700 "$${XDG_RUNTIME_DIR}" + fi +fi +if ! test -f "$${XDG_RUNTIME_DIR}/openrc/softlevel"; then + mkdir -p "$${XDG_RUNTIME_DIR}/openrc" + touch "$${XDG_RUNTIME_DIR}/openrc/softlevel" + chown -R ${USER}:${USER} "$${XDG_RUNTIME_DIR}" + chmod -R 0700 "$${XDG_RUNTIME_DIR}" +fi -- cgit v1.2.3