.xinitrc: Refactor
This commit is contained in:
parent
a3135b9db0
commit
d6f6479f88
38
.xinitrc
38
.xinitrc
@ -6,17 +6,33 @@
|
|||||||
# Distributed under terms of the MIT license.
|
# Distributed under terms of the MIT license.
|
||||||
#
|
#
|
||||||
|
|
||||||
# Set up our session target
|
step_get_target() {
|
||||||
which i3 > /dev/null 2>&1 && export STARTUP="i3"
|
# Set up our session target
|
||||||
which bspwm > /dev/null 2>&1 && export STARTUP="bspwm"
|
which i3 > /dev/null 2>&1 && export STARTUP="i3"
|
||||||
[ -x "$HOME/.concession/conspiracy" ] && export STARTUP="$HOME/.concession/conspiracy"
|
which bspwm > /dev/null 2>&1 && export STARTUP="bspwm"
|
||||||
|
[ -x "$HOME/.concession/conspiracy" ] && export STARTUP="$HOME/.concession/conspiracy"
|
||||||
|
}
|
||||||
|
|
||||||
# Execute Xsession stuff
|
step_start_xsession() {
|
||||||
[ -r /etc/X11/Xsession ] && . /etc/X11/Xsession
|
# Execute Xsession stuff
|
||||||
|
[ -r /etc/X11/Xsession ] && . /etc/X11/Xsession
|
||||||
|
}
|
||||||
|
|
||||||
# Do the do
|
step_start_manual() {
|
||||||
[ -z "${STARTUP+x}" ] || exec "$STARTUP"
|
# 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 $@
|
||||||
|
|
||||||
# Or maybe just die, I guess
|
|
||||||
echo "Failed to start Concession!" >&2
|
|
||||||
exit 1
|
|
||||||
|
Loading…
Reference in New Issue
Block a user