--- a/usr/portage/x11-apps/xinit/files/Xsession 2015-08-09 02:38:18.000000000 +0200 +++ b/usr/portage/x11-apps/xinit/files/Xsession 2020-12-08 11:17:31.402922394 +0100 @@ -10,6 +10,10 @@ esac esac +if [ -n "$*" ]; then + export XSESSION="$*" +fi + # redirect errors to a file in user's home directory if we can for errfile in "$HOME/.xsession-errors" "${TMPDIR-/tmp}/xses-$USER" "/tmp/xses-$USER" do @@ -94,7 +98,20 @@ unset XKB_IN_USE -if [ -x "$startup" ]; then +if [ -n "`/etc/X11/chooser.sh`" ]; then + command="`/etc/X11/chooser.sh`" +fi + +if [ -d /etc/X11/xinit/xinitrc.d ]; then + for f in /etc/X11/xinit/xinitrc.d/?* ; do + [ -x "$f" ] && . "$f" + done + unset f +fi + +if [ -n "$command" ]; then + exec $command +elif [ -x "$startup" ]; then exec "$startup" elif [ -x "$HOME/.Xclients" ]; then exec "$HOME/.Xclients"