home/.xinitrc

39 lines
834 B
Plaintext
Raw Normal View History

#!/bin/sh
#
# Salt's .xinitrc
# Copyright (C) 2018 salt <salt@lap-th-e560-0>
#
# Distributed under terms of the MIT license.
#
2018-10-20 17:07:28 -05:00
step_get_target() {
# Set up our session target
which i3 > /dev/null 2>&1 && export STARTUP="i3"
which bspwm > /dev/null 2>&1 && export STARTUP="bspwm"
[ -x "$HOME/.concession/conspiracy" ] && export STARTUP="$HOME/.concession/conspiracy"
}
2018-10-20 17:07:28 -05:00
step_start_xsession() {
# Execute Xsession stuff
[ -r /etc/X11/Xsession ] && . /etc/X11/Xsession
}
2018-10-20 17:07:28 -05:00
step_start_manual() {
# Execute our target directly
[ -z "${STARTUP+x}" ] || exec "$STARTUP"
}
main() {
# Set up the environment
step_get_target
# Execute our target
step_start_xsession # Through Xsession scripts, or...
step_start_manual # ...manually, if need be
# Or maybe just die, I guess
echo "Failed to start session" >&2
exit 1
}
main $@