data: Use ConditionEnvironment on unit files
Following GNOME/gnome-shell!1472. It's been almost three years since ConditionEnvironment was available. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2791>
This commit is contained 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
|
||||
|
Reference in New Issue
Block a user