Verified Commit 215e654c authored by Iain Lane's avatar Iain Lane

Add systemd user units

The structure is like this:

  -, Top-level
    targets launched directly to start the regular GNOME (Shell) session
    for wayland or x11 respectively.
  - gnome-session@.service: Execute gnome-session-binary tself for the
    specified (template) session. Is active once
    org.gnome.SessionManager is claimed on the bus.
  - Bound to gnome-session@.service - if
    something needs to start after any instance of gnome-session@
    starts, it can be After= this one. gnome-settings-daemon uses this.

We also split out, as it is going to need to
parent 142592d4
Description=gnome-session is on the bus
Description=User systemd services for the GNOME graphical session (wayland)
# start/tear down along with the gnome session
# session leader -- if this dies, die along with it
Description=User systemd services for the GNOME graphical session (x11)
# start/tear down along with the gnome session
# session leader -- if this dies, die along with it
Description=GNOME Session Manager (%i session)
ExecStart=@libexecdir@/gnome-session-binary --ignore-required-components --session=%i
[Desktop Entry]
Comment=This session logs you into GNOME
desktop_plain = 'gnome' # We'd like to have gnome-wayland have output: 'gnome.desktop', but this
# doesn't work So this is later
# renamed in
desktops = [ desktops = [
desktop_plain, ['gnome', 'xsessions'],
'gnome-xorg' ['gnome-xorg', 'xsessions'],
['gnome-wayland', 'wayland-sessions']
] ]
if enable_session_selector if enable_session_selector
desktops += 'gnome-custom-session' desktops += ['gnome-custom-session', 'xsessions']
endif endif
foreach name: desktops foreach name: desktops
desktop_conf = configuration_data() desktop_conf = configuration_data()
desktop_conf.set('bindir', session_bindir) desktop_conf.set('bindir', session_bindir)
desktop = name + '.desktop' desktop = name[0] + '.desktop'
dir = name[1]
desktop_in = configure_file( desktop_in = configure_file(
input: desktop + '', input: desktop + '',
...@@ -21,25 +24,14 @@ foreach name: desktops ...@@ -21,25 +24,14 @@ foreach name: desktops
configuration: desktop_conf configuration: desktop_conf
) )
install_dir = join_paths(session_datadir, 'xsessions') i18n.merge_file(
# FIXME: The same target can not be copied into two directories.
# There is a workaround in until proper solution arises:
if name == desktop_plain
#install_dir: [
# join_paths(session_datadir, 'xsessions'),
# join_paths(session_datadir, 'wayland-sessions')
desktop_target = i18n.merge_file(
desktop, desktop,
type: 'desktop', type: 'desktop',
input: desktop_in, input: desktop_in,
output: desktop, output: desktop,
po_dir: po_dir, po_dir: po_dir,
install: true, install: true,
install_dir: install_dir install_dir: join_paths(session_datadir, dir)
) )
endforeach endforeach
...@@ -88,6 +80,29 @@ install_data( ...@@ -88,6 +80,29 @@ install_data(
install_dir: join_paths(session_datadir, 'GConf', 'gsettings') install_dir: join_paths(session_datadir, 'GConf', 'gsettings')
) )
unit_conf = configuration_data()
unit_conf.set('libexecdir', session_libexecdir)
dep_systemd = dependency('systemd', required: true)
systemd_userunitdir = dep_systemd.get_pkgconfig_variable('systemduserunitdir')
input: '',
output: 'gnome-session@.service',
install: true,
install_dir: systemd_userunitdir,
configuration: unit_conf
systemd_target = files('',
install_dir: systemd_userunitdir
data = files('hardware-compatibility') data = files('hardware-compatibility')
if enable_session_selector if enable_session_selector
...@@ -15,12 +15,7 @@ if not os.environ.get('DESTDIR'): ...@@ -15,12 +15,7 @@ if not os.environ.get('DESTDIR'):
print('Compile gsettings schemas...') print('Compile gsettings schemas...')['glib-compile-schemas', schemadir])['glib-compile-schemas', schemadir])
# FIXME: this is due to unable to copy a generated target file:
dst_dir = os.path.join(install_root, 'wayland-sessions') dst_dir = os.path.join(install_root, 'wayland-sessions')
if not os.path.exists(dst_dir):
src = os.path.join(install_root, 'xsessions', 'gnome.desktop') os.rename(os.path.join(dst_dir, 'gnome-wayland.desktop'),
dst = os.path.join(dst_dir, 'gnome.desktop') os.path.join(dst_dir, 'gnome.desktop'))
shutil.copyfile(src, dst)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment