Trying to boot into X using .xinitrc

So I have a Raspberry PI that has a nice 7" 1024x600 monitor on it that Ubuntu-Mate automatically recognizes and uses - so far so great :slight_smile:

But this is going to be an embedded device, and I want the Pi to boot up X then run my program. I was hoping to run it within .xinitrc, which works fine if I log into the console and run 'startx'. It doesn't work on reboot though, because the session manager takes over and launches the desktop when I log in.

Ideally I don't want the session manager to run at all, I just want (on boot) to start X and have my .xinitrc strut its funky stuff. Is there a way to keep the resolution-detection that Ubuntu-mate does for me, but not have the login process ? (and run my .xinitrc instead!)

@SpacedCowboy, welcome to Ubuntu MATE community.

To avoid the display manager, execute sudo systemctl set-default multi-user.target. This will boot system in console mode instead of graphical mode.

I used to start X automatically when logging to tty1 by adding following (from Gentoo wiki) in my .bash_profile file.
if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then exec startx; fi

Auto-login via console was new to me. Thanks to you, I referred to Arch wiki and the steps are as below.
Create a getty override file with, sudo systemctl edit [email protected] and add following lines in it,

[Service]
ExecStart=
ExecStart=-/usr/sbin/agetty --autologin username --noclear %I $TERM

where username is your login name. Then do, sudo systemctl enable [email protected].

Thank you very much :grinning:

That worked perfectly, and now it logs directly into X and runs my .xinitrc :slight_smile: