Files
snips/dwl.start
Mahesh Asolkar 869ebd595c DWL setup clean up after changing user ID
Making UID within legal range in Arch addressed many systemd related
issues
2025-12-20 22:07:49 -08:00

24 lines
848 B
Bash
Executable File

#!/usr/bin/env bash
# Start DWL
RUNTIME_DIR=$(mktemp --dry-run --suffix=.${USER})
# Escape slashes in the path
# 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}