I keep seeing posts on here where people talk about using LXDE/Lubuntu or XFCE/Xubuntu to try and build a speedy MAME cab and keep memory down. It's prompted me to share how I build my Linux MAME cabinets (6 cabs and counting, spread across Slackware, Debian and Ubuntu). I'm a long time Linux user for home and work (getting on 17 years now), and it's great to see so many folks turning to Linux these days for specific tasks like cab building.
If all you're running on a MAME system is a frontend and emulators (like most cabinets do), you don't need a window manager at all. Window managers are there simply to aid with graphical tools and allow you to position/resize windows easily, load themes and eye candy, etc. For a full screen frontend, you're just throwing away system memory. While probably not an issue for more powerful systems, I like the challenge of seeing what's the oldest hardware I can find to knock together yet another MAME cabinet, and that often means running configurations with just 256-512MB.
You don't need any particular window manager installed to run matching libraries and applications. You can easily run GTK applications out of KDE, and vice versa Qt applications out of GNOME or Unity. You can run anything you like even without a window manager, as long as the relevant libraries are installed.
I use Xorg in all of my current cabinets (still the current graphical subsystem on most popular distros - the bit that sits "underneath" GNOME/KDE/Unity/LXDE/XFCE/etc), and most of this guide works on older XFree86 setups too. I don't use direct frame buffer modes or Mir craziness, so that's all out of scope.
Here's how to do it:
1)
Disable any sort of graphical login manager from running at startup. Ubuntu uses LightDM these days. You might be using GDM with GNOME or other GTK setups, KDM for KDE, etc. Either disable the service via your distro's preferred method, or simply uninstall the relevant package (avoid that if you want to log in to the GUI as a different user at some point). I'll leave disabling of services as "homework".
2)
For the user you want to auto-login on boot (for me, it's always the user "mame"), go to that user's home directory. In that home directory, edit/create a file called ".xinitrc". Note the dot at the front of the filename - this convention means it's a configuration file. In this case, it's the rc (Runtime Configuration) for XInit (the X Initialisation program). In here, you put the full path to the file you want to run when X starts.
This can be a program directly. For example, it could contain something like:
/usr/local/bin/wahcade --full-screen --no-gstreamer --no-pygame
Or it could point to a shell script you've written with a bit more complexity in it.
What this does is execute that particular thing when X starts. When it's all complete, X will die and send you back to the command line. If you want to run several tasks, you can background them with the & character (say, background music, or some power management or screensaver application, etc). For example:
/path/to/music/player some_nice_music.mp3 &
/usr/local/bin/wahcade --full-screen --no-gstreamer --no-pygame
You can test this at any time, by logging in to the command line as the user, and typing "startx". You should see nothing but your chosen program launch, as if you'd launched it from within the GUI.
3)
Now to make it happen at startup. There's a million ways to achieve this. My method is pretty brute-force, but it works.
First, edit /etc/X11/Xwrapper.config (I believe this is Debian/Ubuntu specific), which by default contains the line:
allowed_users=console
This stops X being started by anyone other than a console user. Change it to:
allowed_users=anybody
Then edit your /etc/rc.local to start X as the user in question:
su - mame -c 'startx'
"su" is the user switching tool, as the system starts by default as the root user. The hyphen tells su to completely load the profile of the user you're switching to. Then it's the user's name (again, I have a user called "mame"), then the -c flag informs su to run a particular command on switch, which in our case is 'startx'. The Xwrapper.config allow s any user to start X, and the .xinitrc file tells X what to load when it starts.
There you have it. Auto login, straight to a fullscreen frontend. Use a tool like "htop" to compare your system RAM usage with a window manager and without. You'll be amazed to see how much memory even lightweight window managers gobble up doing absolutely nothing.