--- startx 2021-02-13 14:12:45.000000000 +0100 +++ startx.new 2022-08-08 16:44:21.446295961 +0200 @@ -100,19 +100,6 @@ if [ x"$server" = x ]; then server=$defaultserver - - if [ -x /lib/elogind/elogind -o -x /lib64/elogind/elogind ]; then - # When starting the defaultserver start X on the current tty to avoid - # the startx session being seen as inactive: - # "https://bugzilla.redhat.com/show_bug.cgi?id=806491" - tty=$(tty) - if expr "$tty" : '/dev/tty[0-9][0-9]*$' > /dev/null; then - tty_num=$(echo "$tty" | grep -oE '[0-9]+$') - vtarg="vt$tty_num -keeptty" - fi - fi - - # For compatibility reasons, only use xserverrc if there were no server command line arguments if [ x"$serverargs" = x -a x"$display" = x ]; then if [ -f "$userserverrc" ]; then @@ -215,10 +202,23 @@ done fi +if [ -f $HOME/.xinitrc ] && ! grep -q setxkbmap $HOME/.xinitrc; then + cd $HOME + if grep -q mate-session .xinitrc; then + sed '/exec/i \ +/usr/bin/setxkbmap' .xinitrc > bof + mv bof .xinitrc + else + sed '/DESKTOP_SESSION/i \ +/usr/bin/setxkbmap' .xinitrc > bof + mv bof .xinitrc + fi + cd - +fi +mytmp="/tmp/$(id -nu)" +mkdir -p $mytmp - - -xinit "$client" $clientargs -- "$server" $display $serverargs +xinit "$client" $clientargs -- "$server" $display $serverargs 1>$mytmp/startx.out 2>$mytmp/startx.err retval=$?