[gnome-shell/benzea/systemd-user-units: 4/5] data: Add systemd units to disable extensions
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/benzea/systemd-user-units: 4/5] data: Add systemd units to disable extensions
- Date: Fri, 19 Apr 2019 22:36:19 +0000 (UTC)
commit e6b6c5ee63f4c5e50ef2ac023b02d2854978d343
Author: Benjamin Berg <bberg redhat com>
Date: Mon Apr 15 14:45:14 2019 +0200
data: Add systemd units to disable extensions
when starting using systemd we cannot rely on gnome-session to disable
extensions for us. So add appropriate units to disable extensions when
gnome-shell fails and also display a warning message when the user logs
in the next time.
Also add an appropriate XDG autostart file in case we are not running on
systemd (so that gnome-session can use the same mechanism).
data/gnome-shell-disable-extensions.service | 14 ++++++++++++++
data/gnome-shell-extensions-disabled-warning.service.in | 13 +++++++++++++
data/gnome-shell.service.in | 1 +
data/meson.build | 12 ++++++++++--
4 files changed, 38 insertions(+), 2 deletions(-)
---
diff --git a/data/gnome-shell-disable-extensions.service b/data/gnome-shell-disable-extensions.service
new file mode 100644
index 000000000..69bafa3dd
--- /dev/null
+++ b/data/gnome-shell-disable-extensions.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Disable GNOME Shell extenions after failure
+
+# Do not require gnome-session-failed.target as that would conflict a possible shutdown
+Wants=gnome-session-failed.target
+
+[Service]
+Type=simple
+# Disable extensions and touch a file; if disabling fails for whatever
+# reason then the file will not be touched.
+ExecStartPre=gsettings set org.gnome.shell disable-user-extensions true
+ExecStart=/bin/touch %E/gnome-shell-extensions-disabled-warning
+Restart=no
+
diff --git a/data/gnome-shell-extensions-disabled-warning.service.in
b/data/gnome-shell-extensions-disabled-warning.service.in
new file mode 100644
index 000000000..3c9a5ae6f
--- /dev/null
+++ b/data/gnome-shell-extensions-disabled-warning.service.in
@@ -0,0 +1,13 @@
+[Unit]
+Description=Warn about GNOME Shell extenions being disabled
+ConditionPathExists=%E/gnome-shell-extensions-disabled-warning
+
+Requisite=gnome-session.target
+After=gnome-session.target
+
+[Service]
+Type=simple
+ExecStartPre=-/bin/rm %E/gnome-shell-extensions-disabled-warning
+ExecStart=@bindir@/gnome-shell-extension-prefs --disabled-warning
+Restart=no
+
diff --git a/data/gnome-shell.service.in b/data/gnome-shell.service.in
index 4e141a70d..0d0ba2758 100644
--- a/data/gnome-shell.service.in
+++ b/data/gnome-shell.service.in
@@ -1,5 +1,6 @@
[Unit]
Description=GNOME Shell
+OnFailure=gnome-shell-disable-extensions.service
RefuseManualStart=true
Requisite=gnome-session-manager.target
diff --git a/data/meson.build b/data/meson.build
index df47f4c88..f4dd85ea5 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -104,14 +104,22 @@ if have_systemd
unitconf = configuration_data()
unitconf.set('bindir', bindir)
- unit = configure_file(
+ configure_file(
input: 'gnome-shell.service.in',
output: 'gnome-shell.service',
configuration: unitconf,
install_dir: systemd_userunitdir
)
- units = files('gnome-shell.target')
+ configure_file(
+ input: 'gnome-shell-extensions-disabled-warning.service.in',
+ output: 'gnome-shell-extensions-disabled-warning.service',
+ configuration: unitconf,
+ install_dir: systemd_userunitdir
+ )
+
+ units = files('gnome-shell.target',
+ 'gnome-shell-disable-extensions.service')
install_data(units, install_dir: systemd_userunitdir)
endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]