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