1

I am trying to build a small retro gaming pc and choose to base it on Xubuntu/ubuntu/Xfce. If it is possible I want to set it up too boot as fast as possible directly into mame (maybe other games later too, but first things first). Ideally I would like to have a new default entry in grub to do so.

A possible way I found might be to just set an environment variable from grub, and check this later with some script I start like described here: http://wiki.ubuntuusers.de/Autostart But that would not be very quick I think.

1 Answer 1

2

The link you included with your question explains basic way of creating a startup application for graphical login ( which is exactly what you want ). Basically, Ubuntu runs .desktop files in /etc/xdg/autostart or ~/.config/autostart for each app that you want to start as soon as you log in.

Grub's purpose is to boot the OS, not the apps. If you want to speed up the boot of your OS, minimize number of items on graphical startup and number of services that boot in /etc/init. For instance, with ubuntu 14.04 in /etc/init/bluetooth.conf you can safely add # in front of line start on started dbus to prevent it running on startup.

The way I'd approach such question, is to research first which services I can safely prevent from starting on boot, make an autologin (to avoid typing password each time), and create a startup entry for your game.

Here's an example script with the behavior that you've described in the comments. Place this script into your /usr/bin directory, make sure it has executable permissions by running sudo chmod +x scriptname.sh and add this script as a startup application or add manually a .desktop file into your ~/.config/autostart directory. The script is very simplistic, requires having xdotool which you can get with sudo apt-get install xdotool and well commented, so it should be very self explanatory

#!/bin/sh

# lets see if we have logitech mouse
# connected

xinput | grep -iq logitech

# if we do, then don't do anything
# if we don't launch the game, wait
# 3 seconds
# and simulate pressing F11 key
# to enter full screen mode
if [ $? -eq 1 ]; then
   sol &
   sleep 3
  xdotool key F11
fi 
6
  • Yes thanks, I think that is a good way to go. I managed to start mame via those options and mazbe I can speed it up. But can I hide the normal linux desktop from the user somehow, because if you want to quit Mame, you have to press ESC and return to the desktop before you can power of the machine. I also tried to configure the power button to quit mame and shutdown, but the /etc/acpi/powerbtn.sh seems not to run at all if I am not seeing the desktop.
    – TGGC
    Jun 3, 2015 at 22:27
  • If you mean making the game entering full screen mode and if the full scree mode can be enabled with a keyboard shortcut , then it is possible. I can't tell you about the power button tho - I don't know enough about that. Can you please describe the expected behavior in simple , step by step terms ? Once you do, I'll edit my answer to try to match your expected behavior Jun 4, 2015 at 3:57
  • Essentially i want it to run without a keyboard if I want to. So from the user side, there are 2 use cases: A) - press power on, booting directly into a predefined game - play and if done, press power button to switch of B)
    – TGGC
    Jun 4, 2015 at 6:55
  • B) Connect keyboard, power on and press a key to bot to desktop.
    – TGGC
    Jun 4, 2015 at 7:13
  • So maybe you have a pointer, how I can disable the "unneeded services" only if I go to mame, but not if i go to the normal desktop it would be much appreciated!
    – TGGC
    Jun 4, 2015 at 7:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .