table of contents
- trixie 48.0-1
- testing 48.0-2
- unstable 48.0-2
- experimental 49.0-2
GNOME-SESSION(1) | User Commands | GNOME-SESSION(1) |
NAME¶
gnome-session - Start the GNOME desktop environment
SYNOPSIS¶
gnome-session [OPTION...]
DESCRIPTION¶
The gnome-session program starts up the GNOME desktop environment. This command is typically executed by your login manager (either GDM, SDDM, lightdm, or other). 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). Note that gnome-session is a wrapper script for gnome-session-binary, which does the bulk of the work.
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.
OPTIONS¶
--autostart=DIR
--session=SESSION
--failsafe
--debug
--whale
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
RequiredComponents
Here is an example of a session definition:
[GNOME Session] Name=GNOME RequiredComponents=gnome-shell;gnome-settings-daemon;
In systemd managed sessions, the RequiredComponents may be provided by systemd units instead. See the systemd section for more information on how this works.
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.
SYSTEMD¶
gnome-session will much of the session management over to systemd, if systemd is available. In this case, startup components that have X-GNOME-HiddenUnderSystemd=true set in their .desktop file will be ignored by gnome-session. It instead relies on the fact that these components are managed by systemd.
systemd provides the two special targets for desktop integration: graphical-session.target and graphical-session-pre.target. These work across desktop environments, and should be used if possible. gnome-session provides the following additional GNOME-specific targets:
gnome-session.target
gnome-session-pre.target
gnome-session-x11@SESSION.target, gnome-session-wayland@SESSION.target
gnome-session-x11.target, gnome-session-wayland.target
gnome-session@SESSION.target
gnome-session-x11-services.target
Note that care must be taken to set appropriate After= rules. It is also strongly recommended to always do this in combination with BindsTo= or PartOf= on one of the core targets (e.g. graphical-session.target).
Units are required to set CollectMode=inactive-or-failed. In addition, it is strongly recommended to set TimeoutStopSec=5 so that logout will not be delayed indefinitely in case the process does not stop properly.
ENVIRONMENT¶
gnome-session sets several environment variables for use by the session:
DISPLAY
Behavior of gnome-session ifself can be modified via the following environment variables:
GNOME_SESSION_AUTOSTART_DIR
FILES¶
$XDG_CONFIG_HOME/autostart
$XDG_CONFIG_DIRS/autostart
/usr/share/gnome/autostart
Applications defined via .desktop files in those directories will be started on login.
$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.
$XDG_CONFIG_HOME/gnome-session/saved-sessions
This directory contains the list of applications of the saved session.
BUGS¶
If you find bugs in the gnome-session program, please report these on https://gitlab.gnome.org/GNOME/gnome-session/issues.
SEE ALSO¶
gnome-session |