summaryrefslogtreecommitdiff
path: root/.config/X11/clientrc
blob: 5ffdd97f958d8b49cbe25ea005c57e3ef5a89ced (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/hint/sh

if [ -z "$XDG_RUNTIME_DIR" ]; then
	printf "XDG_RUNTIME_DIR isn't set\n" >&2
	exit 6
fi

_DISPLAY="$(systemd-escape -- "$DISPLAY")"
trap "rm -f $(printf '%q' "${XDG_RUNTIME_DIR}/x11-wm@${_DISPLAY}")" EXIT
mkfifo "${XDG_RUNTIME_DIR}/x11-wm@${_DISPLAY}"

cat < "${XDG_RUNTIME_DIR}/x11-wm@${_DISPLAY}" &
systemctl --user start "X11@${_DISPLAY}.target" &
wait
systemctl --user stop "X11@${_DISPLAY}.target"