.xinitrc: Use more shell builtins, add logging error messages
This commit is contained in:
parent
68f10d0bd3
commit
74751664f6
15
.xinitrc
15
.xinitrc
@ -7,19 +7,22 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
die() {
|
die() {
|
||||||
echo "Failed to start session" >&2
|
if [ -z "$1" ]; then
|
||||||
|
echo "Failed to start session" >&2
|
||||||
|
else
|
||||||
|
echo "Failed to start session: $1" >&2
|
||||||
|
fi
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set up our session target
|
# Set up our session target
|
||||||
which i3 > /dev/null 2>&1 && export STARTUP="i3"
|
command -v i3 > /dev/null 2>&1 && export STARTUP="i3"
|
||||||
which bspwm > /dev/null 2>&1 && export STARTUP="bspwm"
|
command -v bspwm > /dev/null 2>&1 && export STARTUP="bspwm"
|
||||||
[ -x "$HOME/.concession/concession" ] && export STARTUP="$HOME/.concession/concession"
|
|
||||||
if [ -x "$HOME/.dsk/dsk-xinit" ]; then
|
if [ -x "$HOME/.dsk/dsk-xinit" ]; then
|
||||||
export DSK_HOME="$HOME/.dsk"
|
export DSK_HOME="$HOME/.dsk"
|
||||||
export STARTUP="$DSK_HOME/dsk-xinit"
|
export STARTUP="$DSK_HOME/dsk-xinit"
|
||||||
fi
|
fi
|
||||||
[ -z ${STARTUP+x} ] && die
|
[ -z ${STARTUP+x} ] && die "No session target available"
|
||||||
|
|
||||||
# Execute Xsession stuff
|
# Execute Xsession stuff
|
||||||
[ -r /etc/X11/Xsession ] && . /etc/X11/Xsession
|
[ -r /etc/X11/Xsession ] && . /etc/X11/Xsession
|
||||||
@ -28,5 +31,5 @@ fi
|
|||||||
[ -z "${STARTUP+x}" ] || exec "$STARTUP"
|
[ -z "${STARTUP+x}" ] || exec "$STARTUP"
|
||||||
|
|
||||||
# If we get here, we haven't exec'd a target and must die
|
# If we get here, we haven't exec'd a target and must die
|
||||||
die
|
die "Miscellaneous error"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user