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:
16
dwl.start
16
dwl.start
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user