diff --git a/data/org.gnome.Shell@wayland.service.in b/data/org.gnome.Shell@wayland.service.in index 76d5ccb1b..a1980e8a5 100644 --- a/data/org.gnome.Shell@wayland.service.in +++ b/data/org.gnome.Shell@wayland.service.in @@ -13,14 +13,12 @@ Requisite=gnome-session-initialized.target PartOf=gnome-session-initialized.target Before=gnome-session-initialized.target +#NOTE: ConditionEnvironment works with systemd >= 246 +ConditionEnvironment=XDG_SESSION_TYPE=%I + [Service] Slice=session.slice Type=notify -# NOTE: This can be replaced with ConditionEnvironment=XDG_SESSION_TYPE=%I in -# the [Unit] section with systemd >= 246. Also, the current solution is -# kind of painful as systemd had a bug where it retries the condition. -# Only start if the template instance matches the session type. -ExecCondition=/bin/sh -c 'test "$XDG_SESSION_TYPE" = "%I" || exit 2' ExecStart=@bindir@/gnome-shell # Exit code 1 means we are probably *not* dealing with an extension failure SuccessExitStatus=1 diff --git a/data/org.gnome.Shell@x11.service.in b/data/org.gnome.Shell@x11.service.in index 078d87a3c..e5785b453 100644 --- a/data/org.gnome.Shell@x11.service.in +++ b/data/org.gnome.Shell@x11.service.in @@ -13,6 +13,9 @@ Requisite=gnome-session-initialized.target PartOf=gnome-session-initialized.target Before=gnome-session-initialized.target +#NOTE: ConditionEnvironment works with systemd >= 246 +ConditionEnvironment=XDG_SESSION_TYPE=%I + # Limit startup frequency more than the default StartLimitIntervalSec=15s StartLimitBurst=3 @@ -20,11 +23,6 @@ StartLimitBurst=3 [Service] Slice=session.slice Type=notify -# NOTE: This can be replaced with ConditionEnvironment=XDG_SESSION_TYPE=%I in -# the [Unit] section with systemd >= 246. Also, the current solution is -# kind of painful as systemd had a bug where it retries the condition. -# Only start if the template instance matches the session type. -ExecCondition=/bin/sh -c 'test "$XDG_SESSION_TYPE" = "%I" || exit 2' ExecStart=@bindir@/gnome-shell # Exit code 1 means we are probably *not* dealing with an extension failure SuccessExitStatus=1