42 lines
948 B
Bash
Executable File
42 lines
948 B
Bash
Executable File
#!/bin/sh
|
|
# sourced by latchd before starting an X11 session.
|
|
# runs the user's xprofile, xinitrc fragments, and xsession.
|
|
|
|
_xexec="$1"
|
|
shift
|
|
|
|
# source shell profiles
|
|
if [ -f /etc/profile ]; then
|
|
. /etc/profile
|
|
fi
|
|
shell="${SHELL##*/}"
|
|
case "$shell" in
|
|
zsh) [ -f "$HOME/.zprofile" ] && . "$HOME/.zprofile" ;;
|
|
bash) [ -f "$HOME/.bash_profile" ] && . "$HOME/.bash_profile" ;;
|
|
*) [ -f "$HOME/.profile" ] && . "$HOME/.profile" ;;
|
|
esac
|
|
|
|
# source x profiles
|
|
[ -f /etc/xprofile ] && . /etc/xprofile
|
|
[ -f "$HOME/.xprofile" ] && . "$HOME/.xprofile"
|
|
|
|
# run xinitrc.d scripts
|
|
for _f in /etc/X11/xinit/xinitrc.d/*; do
|
|
[ -x "$_f" ] && . "$_f"
|
|
done
|
|
|
|
# run Xsession.d scripts
|
|
for _f in /etc/X11/Xsession.d/*; do
|
|
[ -x "$_f" ] && . "$_f"
|
|
done
|
|
|
|
# load xresources
|
|
if [ -f "$HOME/.Xresources" ]; then
|
|
xrdb -merge "$HOME/.Xresources"
|
|
fi
|
|
|
|
# run xsession
|
|
[ -f "$HOME/.xsession" ] && . "$HOME/.xsession"
|
|
|
|
exec $_xexec "$@"
|