snips/dwl.start

18 lines
646 B
Plaintext
Raw Normal View History

2021-05-29 22:40:00 +00:00
#!/usr/bin/env bash
# Start DWL
RUNTIME_DIR=$(mktemp --directory --suffix=.${USER})
# Escape slashes in the path
SNAME=$(systemd-escape ${RUNTIME_DIR}.service)
# 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_SESSION_ID && \
2021-05-29 22:40:00 +00:00
systemctl --wait --user start dwl@${SNAME} && \
rm -rf ${RUNTIME_DIR}