# Autobooting into your application

This is useful if you have an art installation you want to be able to turn on and automatically run your program, or if you want different setups to choose from (starting without a graphical desktop for example).

## The simple way

is to use the autostarted app list in xfce, which is found in the main menu. Here you can add commands to be executed when xfce starts.

## The more complex way

This way we use the GRUB bootloader to choose between different setups called 'runlevels' (explained below). With this method it is possible to choose exactly what processes we want the computer to run.This is mostly taken from nescivi's howto on booting into SuperCollider, and will show an example of loading "emacs -sclang" without the graphical interface. A small program called screen is also used, which allows you to have a shell, that you can exit (but any programs that are running will keep running) and resume later on, even after having logged out and in again.

### GRUB

In GRUB you have to add an entry to boot into the runlevel you want. In the file /boot/grub/menu.lst, copy the field of your pure:dyne entry and at the end of the kernel line add the number of the runlevel you are going to use (3 is a good choice), for example:

### Runlevel

Runlevels are basically a series of scripts that will be executed when booting or halting the system. On Debian systems, you will find these in directories called /etc/rcN.d where "N" is the number of the runlevel. Choose one of the runlevels that aren't really used (2 is used by Debian as a default, 6 is usually connected to shutting down), and adapt that runlevel. In this directory you have to place all the symlinks for scripts that need to be executed and you can take away the ones you don't need (for example the one starting the graphical interface). To start screen, emacs and sc, make a symlink like:

### Startup script

Make a file called mystartupscript.sh in your home directory and fill it with this:
then make the file executable for all users:

### .screen

Make a file called .screen in your home directory and fill it with this:
then make the file executable for all users:

### startemacs.sh

(SuperCollider specific) In this file you have to set a couple of paths, so libraries can be found. And you have to start emacs with the startup file of the user, as that is where you'll probably have put the special sclang-commands. Make a file called startemacs.sh in your home directory and fill it with this:
then make the file executable for all users:

### .sclang.sc

(SuperCollider specific) This file should already exist in your home directory and be configured to your needs. Add this part at the end to load your patch:
0.1.wait; s.quit; 0.5.wait;
s.boot; 1.wait;
s.doWhenBooted( { { "/home/lintian/SuperCollider/startMyCoolPatch.scd".load }.defer; });

### Disabling the graphical desktop

To prevent xfce from starting we have to remove a symlink in the runlevel directory:

### Shutting down

Currently pure:dyne prompts you to 'remove any disk in the tray and push ENTER' as a part of the shut down procedure. This will change soon, but in the mean time we can fix it with a small hack.
and in this file, remove this part:
You might also want to turn off the computer with the power button. In which case, edit...

### And it runs...

Now the whole thing should be running as desired and you can login to the computer after it has booted. Type:
to enter the app you have started.

### Other tweaks

If you do not want to attach a keyboard and mouse to the computer, it may be necessary to make a change in the BIOS of the computer, to ensure that the computer doesn't halt when there is no keyboard found. Look for an option concerning "halt on any errors" or the like, and make sure it will not.