1GNOME-SESSION(1) General Commands Manual GNOME-SESSION(1)
2
3
4
6 gnome-session - Start the GNOME desktop environment
7
9 gnome-session [-a|--autostart=DIR] [--session=SESSION] [--failsafe|-f]
10 [--debug] [--whale]
11
13 The gnome-session program starts up the GNOME desktop environment. This
14 command is typically executed by your login manager (either gdm, xdm,
15 or from your X startup scripts). It will load either your saved ses‐
16 sion, or it will provide a default session for the user as defined by
17 the system administrator (or the default GNOME installation on your
18 system). Note that gnome-session is a wrapper script for gnome-session-
19 binary.
20
21 The default session is defined in gnome.session, a .desktop-like file
22 that is looked for in $XDG_CONFIG_HOME/gnome-session/sessions,
23 $XDG_CONFIG_DIRS/gnome-session/sessions and $XDG_DATA_DIRS/gnome-ses‐
24 sion/sessions.
25
26 When saving a session, gnome-session saves the currently running appli‐
27 cations in the $XDG_CONFIG_HOME/gnome-session/saved-session directory.
28 Saving sessions is only supported with the legacy non-systemd startup
29 method.
30
31 gnome-session is an X11R6 session manager. It can manage GNOME applica‐
32 tions as well as any X11R6 SM compliant application.
33
35 The following options are supported:
36
37 --autostart=DIR
38 The directory DIR to be searched for autostart .desktop files.
39 This option can be used multiple times. When this option is
40 present, then default autostart directories will not be
41 searched.
42
43 --session=SESSION
44 Use the applications defined in SESSION.session. If not speci‐
45 fied, gnome.session will be used.
46
47 --builtin
48 Use the legacy non-systemd method of managing the user session.
49 This is the opposite of the --systemd option.
50
51 --systemd
52 Use the systemd method of managing the user session. This is the
53 opposite of the --builtin option.
54
55 --failsafe
56 Run in fail-safe mode. User-specified applications will not be
57 started.
58
59 --debug
60 Enable debugging code.
61
62 --whale
63 Show the fail whale in a dialog for debugging it.
64
66 Sessions are defined in .session files, that are using a .desktop-like
67 format, with the following keys in the GNOME Session group:
68
69 Name Name of the session. This can be localized.
70
71 RequiredComponents
72 List of component identifiers (desktop files) that are required
73 by the session. The required components will always run in the
74 session.
75
76 Here is an example of a session definition:
77
78 [GNOME Session]
79 Name=GNOME
80 RequiredComponents=gnome-shell;gnome-settings-daemon;
81
82 In systemd managed sessions the RequiredComponents may be provided by
83 systemd units instead. In this case the corresponding .desktop file
84 needs to contain X-GNOME-HiddenUnderSystemd=true. gnome-session will
85 ignore these components and rely on systemd to manage them appropri‐
86 ately, see the systemd for more information on how this works.
87
88 The .session files are looked for in $XDG_CONFIG_HOME/gnome-ses‐
89 sion/sessions, $XDG_CONFIG_DIRS/gnome-session/sessions and
90 $XDG_DATA_DIRS/gnome-session/sessions.
91
93 gnome-session can pass much of the session management over to systemd
94 (see the --systemd option which may be the default since 3.34). In this
95 case, startup components that have X-GNOME-HiddenUnderSystemd=true set
96 in their .desktop file will be ignored by gnome-session. It instead
97 relies on the fact that these components are managed by systemd.
98
99 As of GNOME 3.34 the systemd support is new and the customizing the
100 configuration is not yet easily possible. With GNOME 3.34 it may be
101 best to use --builtin if session customizations are required. This is
102 due to the way that GNOME currently defines the components that will be
103 started on each session type.
104
105 systemd provides the two special targets graphical-session.target and
106 graphical-session-pre.target which are fully functional and should be
107 used. gnome-session provides the following main targets:
108
109 gnome-session.target
110 Generic unit that will be active throughout the session. Similar
111 to graphical-session.target.
112
113 gnome-session-pre.target
114 Used for tasks that need to be done before session startup. Sim‐
115 ilar to graphical-session-pre.target.
116
117 gnome-session-x11@SESSION.target gnome-session-wayland@SESSION.target
118 Main unit started for X11/wayland based session. SESSION is set
119 according to the session that is passed in --session.
120
121 gnome-session-x11.target gnome-session-wayland.target
122 Convenience units without the session embedded into the target.
123
124 gnome-session@SESSION.target
125 Convenience unit with just the SESSION information embedded.
126
127 gnome-session-x11-services.target
128 Special unit started when X11 services are needed. This will be
129 used from GNOME 3.36 onwards. Programs will need to use the spe‐
130 cial GNOME_SETUP_DISPLAY environment variable instead of DIS‐
131 PLAY.
132
133 Note that care must be taken to set appropriate After= rules. It is
134 also strongly recommended to always do this in combination with Bind‐
135 sTo= or PartOf= on one of the core targets (e.g. graphical-session.tar‐
136 get).
137
138 Units are required to set CollectMode=inactive-or-failed. In addition,
139 it is strongly recommended to set TimeoutStopSec=5 so that logout will
140 not be delayed indefinitely in case the process does not stop properly.
141
143 gnome-session sets several environment variables for the use of its
144 child processes:
145
146 SESSION_MANAGER
147
148 This variable is used by session-manager aware clients to con‐
149 tact gnome-session.
150
151 DISPLAY
152
153 This variable is set to the X display being used by gnome-ses‐
154 sion. Note that if the --display option is used this might be
155 different from the setting of the environment variable when
156 gnome-session is invoked.
157
158 Behavior of gnome-session ifself can be modified via the following
159 environment variable:
160
161 GNOME_SESSION_AUTOSTART_DIR
162
163 This variable specifies a list of directories to the searched
164 for autostart files. This variable overrides all directories
165 specified via the --autostart option, as well as all default
166 autostart directories.
167
169 $XDG_CONFIG_HOME/autostart $XDG_CONFIG_DIRS/autostart
170 /usr/share/gnome/autostart
171
172 Applications defined via .desktop files in those directories
173 will be started on login.
174
175 $XDG_CONFIG_HOME/gnome-session/sessions $XDG_CONFIG_DIRS/gnome-ses‐
176 sion/sessions $XDG_DATA_DIRS/gnome-session/sessions
177
178 These directories contain the .session files that can be used
179 with the --session option.
180
181 $XDG_CONFIG_HOME/gnome-session/saved-session
182
183 This directory contains the list of applications of the saved
184 session.
185
187 If you find bugs in the gnome-session program, please report these on
188 https://gitlab.gnome.org/GNOME/gnome-session/issues.
189
191 gnome-session-quit(1)
192
193
194
195GNOME May 2020 GNOME-SESSION(1)