Buddha

Buddha
Seek

Thursday, February 14, 2008

Starting an App with GNOME Startup

There are times when you would like to start certain app when GNOME
starts up. This is just like the Windows Startup program. In Windows
[Win XP] we used to place the links to the programs in the Startup
Folder.

On my machine I have Fedora Core 7 and Ubuntu 7.10 (Gutsy Gib). Now I
tried this on FC7 , worked perfectly.

Steps.

1. Open a terminal and login as root.

2. Now locate the file read by GNOME when it starts a default session.
The file is named as "default.session" and for me its path was
"/usr/share/gnome/default.session". If for you the file does not exist
there, you can look for the file by using the command
"find / -name default.session". The file will be stored under a
directory named gnome.

3. Once you get the file open it with a text editor.

4. It will be something like this:
------------------------------------------------------------------------------------------------------------------------
# This is the default session that is launched if the user doesn't
# already have a session.
# The RestartCommand specifies the command to run from the $PATH.
# The Priority determines the order in which the commands are started
# (with Priority = 0 first) and defaults to 50.
# The id provides a name that is unique within this file and passed to
the
# app as the client id which it must use to register with gnome-session.
# The clients must be numbered from 0 to the value of num_clients - 1.

[Default]
num_clients=6
0,id=default0
0,Priority=60
0,RestartCommand=pam-panel-icon --sm-client-id default0
1,id=default1
1,Priority=10
1,RestartCommand=gnome-wm --default-wm gnome-wm --sm-client-id default1
2,id=default2
2,Priority=40
2,RestartCommand=gnome-panel --sm-client-id default2
3,id=default3
3,Priority=40
3,RestartCommand=nautilus --no-default-window --sm-client-id default3
4,id=default4
4,Priority=40
4,RestartCommand=gnome-volume-manager --sm-client-id default4
5,id=default5
5,Priority=41
5,RestartCommand=evolution

------------------------------------------------------------------------------------------------------------------------
Now on everything is pretty simple. OK the entries.

num_clients=6 - It is the number of clients that would start once the
default session starts/

The numbers 0,1,2,3,4,5 are the application numbers. These along with
the id are used to mark an application.

Priority=[Num]. Each application has a different priority numbers which
states the criticality of the app. The point to be noted here is higher
the priority number is, the lesser critical the app is. In most systems
the highest priority is set to be 0 where as the minimum priority is 50.

e.g. I added evolution to startup. This was simple, I changed the
num_clients to 6 from 5, then added the last 3 lines to the file and
saved it. The next time I restarted GNOME, "Lo. Evolution was up :D"