Linux Commands Examples

A great documentation place for Linux commands


Start the GNOME desktop environment

see also : gnome-session-properties - gnome-session-quit


gnome-session [-a|--autostart=DIR] [--session=SESSION] [--failsafe|-f] [--debug] [--whale]

add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!


exec gnome-session &
exec awesome

Preventing auto-restart of nautilus on gnome 2.28

Edit the appropriate file in ~/.config/autostart/ and change: X-GNOME-AutoRestart=true to: X-GNOME-AutoRestart=false

If you want to stop something like Nautilus, I suspect you may be able to override system defaults by copying the nautilus .desktop file to that folder, or else you'll have to edit the system file.


The gnome-session program starts up the GNOME desktop environment. This command is typically executed by your login manager (either gdm, xdm, or from your X startup scripts). It will load either your saved session, or it will provide a default session for the user as defined by the system administrator (or the default GNOME installation on your system).

The default session is defined in gnome.session, a .desktop-like file that is looked for in $XDG_CONFIG_HOME/gnome-session/sessions, $XDG_CONFIG_DIRS/gnome-session/sessions and $XDG_DATA_DIRS/gnome-session/sessions.

When saving a session, gnome-session saves the currently running applications in the $XDG_CONFIG_HOME/gnome-session/saved-session directory.

gnome-session is an X11R6 session manager. It can manage GNOME applications as well as any X11R6 SM compliant application.


The following options are supported:

Start all applications defined in DIR, instead of starting the applications defined in gnome.session, or via the --session option. Multiple --autostart options can be passed.


Use the applications defined in SESSION.session. If not specified, gnome.session will be used.


Run in fail-safe mode. User-specified applications will not be started.


Enable debugging code.


Show the fail whale in a dialog for debugging it.


gnome-session sets several environment variables for the use of its child processes:


This variable is used by session-manager aware clients to contact gnome-session.


This variable is set to the X display being used by gnome-session. Note that if the --display option is used this might be different from the setting of the environment variable when gnome-session is invoked.


$XDG_CONFIG_HOME/config/autostart $XDG_CONFIG_DIRS/config/autostart /usr/share/gnome/autostart

The applications defined in those directories will be started on login. gnome-session-properties(1) can be used to easily configure them.

$XDG_CONFIG_HOME/gnome-session/sessions $XDG_CONFIG_DIRS/gnome-session/sessions $XDG_DATA_DIRS/gnome-session/sessions

These directories contain the .session files that can be used with the --session option.


This directory contains the list of applications of the saved session.

session definition

Sessions are defined in .session files, that are using a .desktop-like format, with the following keys in the GNOME Session group:


Name of the session. This can be localized.


List of component identifiers (desktop files) that are required by the session. The required components will always run in the session.


List of task providers that are required by the session. A default provider for each task has to be defined with a DefaultProvider-TASK key; the provider can be overridden by required components, the saved session or autostart applications. The task providers will always run in the session.


Identifier (desktop file) of the default provider for TASK. If no provider for TASK is found in the required components, the saved session and in the autostart applications, the default provider will be started.

Here is an example of a session definition:

[GNOME Session]
Name=GNOME fallback

The .session files are looked for in $XDG_CONFIG_HOME/gnome-session/sessions, $XDG_CONFIG_DIRS/gnome-session/sessions and $XDG_DATA_DIRS/gnome-session/sessions.


If you find bugs in the gnome-session program, please report these on

see also

gnome-session-properties gnome-session-quit

How can this site be more helpful to YOU ?

give  feedback