1
0
mirror of https://github.com/Foltik/dotfiles synced 2024-11-28 13:36:59 -05:00
dotfiles/lain/.xinitrc

34 lines
1022 B
Plaintext
Raw Normal View History

2018-12-01 13:32:58 -05:00
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
2018-12-03 18:47:58 -05:00
sysresources=/etc/x11/xinit/.Xresources
sysmodmap=/etc/x11/xinit/.Xmodmap
2018-12-01 13:32:58 -05:00
# merge in defaults and keymaps
2018-12-03 18:47:58 -05:00
if [ -f $sysresources ]; then xrdb -merge $sysresources; fi
if [ -f $sysmodmap ]; then xmodmap $sysmodmap; fi
if [ -f $userresources ]; then xrdb -merge $userresources; fi
if [ -f $usermodmap ]; then xmodmap $usermodmap; fi
if [ -d /etc/x11/xinit/xinitrc.d ]; then
for f in /etc/x11/xinit/xinitrc.d/?*.sh ; do
[ -x "$f" ] && . "$f"
done
unset f
2018-12-01 13:32:58 -05:00
fi
2018-12-03 18:47:58 -05:00
# The window manager will open this named pipe, closing it once it exits.
mkfifo "${XDG_RUNTIME_DIR}/x11-wm@${DISPLAY:1:2}"
2018-12-01 13:32:58 -05:00
2018-12-03 18:47:58 -05:00
# Delete the pipe on exit
trap "rm -f ${XDG_RUNTIME_DIR}/x11-wm@${DISPLAY:1:2}" EXIT
2018-12-01 13:32:58 -05:00
2018-12-03 18:47:58 -05:00
# Fork a process that will exit once the pipe is closed
cat < "${XDG_RUNTIME_DIR}/x11-wm@${DISPLAY:1:2}" &
2018-12-01 13:32:58 -05:00
2018-12-03 18:47:58 -05:00
systemctl --user start "x11@${DISPLAY:1:2}.target" &
# Wait for the pipe (window manager) to close
wait
systemctl --user stop "x11@${DISPLAY:1:2}.target" &