DWL setup clean up after changing user ID

Making UID within legal range in Arch addressed many systemd related
issues
This commit is contained in:
2025-12-20 22:07:49 -08:00
parent 1946b362e8
commit 869ebd595c
4 changed files with 20 additions and 12 deletions

View File

@@ -1,17 +1,23 @@
#!/usr/bin/env bash
# Start DWL
RUNTIME_DIR=$(mktemp --directory --suffix=.${USER})
RUNTIME_DIR=$(mktemp --dry-run --suffix=.${USER})
# Escape slashes in the path
SNAME=$(systemd-escape ${RUNTIME_DIR}.service)
# SNAME=$(systemd-escape $(basename ${RUNTIME_DIR}).service)
SNAME=${USER}_${XDG_VTNR}
export XDG_SESSION_CLASS=user
echo "#################"
echo "$XDG_RUNTIME_DIR"
echo "#################"
# Start service blocking. Remove runtime directory upon completion.
# Be sure to import XDG session variables for graphical-session to work
systemctl --user import-environment XDG_SEAT && \
systemctl --user import-environment XDG_SESSION_TYPE && \
systemctl --user import-environment XDG_SESSION_CLASS && \
systemctl --user import-environment XDG_VTNR && \
systemctl --user import-environment XDG_RUNTIME_DIR && \
systemctl --user import-environment XDG_SESSION_ID && \
systemctl --wait --user start dwl@${SNAME} && \
rm -rf ${RUNTIME_DIR}
systemctl --wait --user start dwl@${SNAME}
# && \
# rm -rf ${RUNTIME_DIR}