2018-10-20 14:09:54 -05:00
|
|
|
#!/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:13:39 -05:00
|
|
|
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"
|
2018-11-04 18:10:29 -06:00
|
|
|
[ -x "$HOME/.concession/concession" ] && export STARTUP="$HOME/.concession/concession"
|
2018-10-20 17:13:39 -05:00
|
|
|
[ -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 14:09:54 -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 14:09:54 -05:00
|
|
|
|
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
|
2018-10-20 17:13:39 -05:00
|
|
|
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
|
2018-10-20 17:13:39 -05:00
|
|
|
die
|
2018-10-20 17:07:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
main $@
|
2018-10-20 14:09:54 -05:00
|
|
|
|