home/.xinitrc

55 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

#!/bin/sh
#
# Salt's .xinitrc
# Copyright (C) 2018 salt <salt@lap-th-e560-0>
#
# Distributed under terms of the MIT license.
#
die() {
echo "Failed to start session" >&2
exit 1
}
step_setup_target() {
2018-10-20 17:07:28 -05:00
# 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/concession" ] && export STARTUP="$HOME/.concession/concession"
[ -z ${STARTUP+x} ] && die
}
step_setup_env() {
# Ideally, you'd hook into a bunch of different DE startup stuff here
# But I only use Plasma, so there's only that here
if which kdeinit5 > /dev/null 2>&1; then
kdeinit5 &
kded5 &
export STARTUP="ksmserver \"$STARTUP\" --no-lockscreen"
fi
2018-10-20 17:07:28 -05:00
}
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_setup_target
#step_setup_env
2018-10-20 17:07:28 -05:00
# Execute our target
step_start_xsession # Through Xsession scripts, or...
step_start_manual # ...manually, if need be
# Or maybe just die, I guess
die
2018-10-20 17:07:28 -05:00
}
main $@