Add systemd units
So that we can be started by systemd --user, instead of gnome-session. There are three units: - gnome-shell.service: Start gnome-shell itself. - gnome-shell-x11.target, gnome-shell-wayland.target: Sync points for units that need to care if x11 or wayland is in use. gnome-settings-daemon will use these, for example. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/138
This commit is contained in:
parent
e36ba874a8
commit
a5937d1d6d
5
data/gnome-shell-wayland.target
Normal file
5
data/gnome-shell-wayland.target
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=GNOME Shell (wayland sync point)
|
||||||
|
After=gnome-shell.service
|
||||||
|
BindsTo=gnome-shell.service
|
||||||
|
Conflicts=gnome-shell-x11.target
|
5
data/gnome-shell-x11.target
Normal file
5
data/gnome-shell-x11.target
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=GNOME Shell (x11 sync point)
|
||||||
|
After=gnome-shell.service
|
||||||
|
BindsTo=gnome-shell.service
|
||||||
|
Conflicts=gnome-shell-wayland.target
|
11
data/gnome-shell.service.in
Normal file
11
data/gnome-shell.service.in
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=GNOME Shell
|
||||||
|
Wants=gnome-session.service
|
||||||
|
After=graphical-session-pre.target gnome-session-bus.target
|
||||||
|
PartOf=graphical-session.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=dbus
|
||||||
|
ExecStart=@bindir@/gnome-shell
|
||||||
|
Restart=on-failure
|
||||||
|
BusName=org.gnome.Shell
|
@ -93,6 +93,23 @@ schema = configure_file(
|
|||||||
install_dir: schemadir
|
install_dir: schemadir
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if have_systemd
|
||||||
|
unitconf = configuration_data()
|
||||||
|
unitconf.set('bindir', bindir)
|
||||||
|
|
||||||
|
unit = configure_file(
|
||||||
|
input: 'gnome-shell.service.in',
|
||||||
|
output: 'gnome-shell.service',
|
||||||
|
configuration: unitconf,
|
||||||
|
install_dir: systemduserunitdir
|
||||||
|
)
|
||||||
|
|
||||||
|
units = files('gnome-shell-wayland.target',
|
||||||
|
'gnome-shell-x11.target')
|
||||||
|
|
||||||
|
install_data(units, install_dir: systemduserunitdir)
|
||||||
|
endif
|
||||||
|
|
||||||
# for unit tests - gnome.compile_schemas() only looks in srcdir
|
# for unit tests - gnome.compile_schemas() only looks in srcdir
|
||||||
custom_target('compile-schemas',
|
custom_target('compile-schemas',
|
||||||
input: schema,
|
input: schema,
|
||||||
|
15
meson.build
15
meson.build
@ -59,6 +59,13 @@ servicedir = join_paths(datadir, 'dbus-1', 'services')
|
|||||||
|
|
||||||
plugindir = get_variable('BROWSER_PLUGIN_DIR', mozplugindir)
|
plugindir = get_variable('BROWSER_PLUGIN_DIR', mozplugindir)
|
||||||
|
|
||||||
|
# XXX: Once https://github.com/systemd/systemd/issues/9595 is fixed and we can
|
||||||
|
# depend on this version, replace with something like:
|
||||||
|
# systemduserunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir',
|
||||||
|
# define_variable: ['prefix', prefix])
|
||||||
|
# and uncomment systemd_dep below
|
||||||
|
systemduserunitdir = join_paths(libdir, 'systemd', 'user')
|
||||||
|
|
||||||
keybindings_dep = dependency('gnome-keybindings', required: false)
|
keybindings_dep = dependency('gnome-keybindings', required: false)
|
||||||
if keybindings_dep.found()
|
if keybindings_dep.found()
|
||||||
keysdir = keybindings_dep.get_pkgconfig_variable('keysdir')
|
keysdir = keybindings_dep.get_pkgconfig_variable('keysdir')
|
||||||
@ -117,10 +124,12 @@ else
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if get_option('systemd')
|
if get_option('systemd')
|
||||||
systemd_dep = dependency('libsystemd')
|
libsystemd_dep = dependency('libsystemd')
|
||||||
have_systemd = systemd_dep.found()
|
# XXX: see systemduserunitdir
|
||||||
|
# systemd_dep = dependency('systemd')
|
||||||
|
have_systemd = true
|
||||||
else
|
else
|
||||||
systemd_dep = []
|
libsystemd_dep = []
|
||||||
have_systemd = false
|
have_systemd = false
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ gnome_shell_deps = [
|
|||||||
canberra_dep, canberra_gtk_dep,
|
canberra_dep, canberra_gtk_dep,
|
||||||
polkit_dep,
|
polkit_dep,
|
||||||
gcr_dep,
|
gcr_dep,
|
||||||
systemd_dep
|
libsystemd_dep
|
||||||
]
|
]
|
||||||
|
|
||||||
gnome_shell_deps += nm_deps
|
gnome_shell_deps += nm_deps
|
||||||
|
Loading…
Reference in New Issue
Block a user