diff -Nurp gdm-3.38.2.1.orig/data/Xsession.in gdm-3.38.2.1/data/Xsession.in --- gdm-3.38.2.1.orig/data/Xsession.in 1970-01-01 02:00:00.000000000 +0200 +++ gdm-3.38.2.1/data/Xsession.in 2021-01-08 16:32:13.435962298 +0200 @@ -181,13 +181,26 @@ if [ -d /usr/etc/X11/xinit/xinitrc.d ]; fi done fi -if [ -d /etc/X11/xinit/xinitrc.d ]; then - for i in /etc/X11/xinit/xinitrc.d/* ; do - if [ -x "$i" -a ! -d "$i" ]; then - . "$i" + +# run scripts in /etc/X11/xinit.d and /etc/X11/xinit/xinitrc.d +DESKTOP=${1##*/} +SESSION=$DESKTOP +for i in /etc/X11/xinit.d/* /etc/X11/xinit/xinitrc.d/* ; do + [ -d $i ] && continue + # Don't run ??foo.{rpmsave,rpmorig,rpmnew,~} scripts + [ "${i%.rpmsave}" != "${i}" ] && continue + [ "${i%.rpmorig}" != "${i}" ] && continue + [ "${i%.rpmnew}" != "${i}" ] && continue + [ "${i%\~}" != "${i}" ] && continue + + if [ -x $i ]; then + if grep -q "# to be sourced" $i; then + . $i "${SESSION}" + else + $i "${SESSION}" & fi - done -fi + fi +done if [ "x$command" = "xdefault" ] ; then if [ -x "$HOME/.Xclients" ]; then