From 8142cdf82f40b02ad643bd9ca2e9c775cca4b81a Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Mon, 1 Feb 2021 13:44:12 +0000 Subject: [PATCH] systemd: add missing WantedBy= properties to user units This fixes some inconsistent and incorrect startup order of the graphical and desktop targets. xprofile will now always run as part of xorg.target, which is before all other X-related applications that require those settings to be in place beforehand. Signed-off-by: Joe Groocock --- .../user/default.target.wants/redshift.service | 1 - systemd/user/dunst.service.d/override.conf | 3 +++ systemd/user/graphical-session.target | 15 +++++++++++++++ .../autocutsel-primary.service | 1 - .../autocutsel.service | 1 - .../dunst.service | 0 .../redshift.service | 1 + .../xautolock.service | 1 - systemd/user/redshift.service | 13 +++++++++++++ systemd/user/redshift.service.d/override.conf | 2 -- 10 files changed, 32 insertions(+), 6 deletions(-) delete mode 120000 systemd/user/default.target.wants/redshift.service create mode 100644 systemd/user/graphical-session.target delete mode 120000 systemd/user/graphical-session.target.wants/autocutsel-primary.service delete mode 120000 systemd/user/graphical-session.target.wants/autocutsel.service rename systemd/user/{default.target.wants => graphical-session.target.wants}/dunst.service (100%) create mode 120000 systemd/user/graphical-session.target.wants/redshift.service delete mode 120000 systemd/user/graphical-session.target.wants/xautolock.service create mode 100644 systemd/user/redshift.service delete mode 100644 systemd/user/redshift.service.d/override.conf diff --git a/systemd/user/default.target.wants/redshift.service b/systemd/user/default.target.wants/redshift.service deleted file mode 120000 index a9cf4c7..0000000 --- a/systemd/user/default.target.wants/redshift.service +++ /dev/null @@ -1 +0,0 @@ -/usr/lib/systemd/user/redshift.service \ No newline at end of file diff --git a/systemd/user/dunst.service.d/override.conf b/systemd/user/dunst.service.d/override.conf index 09bac38..f4d215f 100644 --- a/systemd/user/dunst.service.d/override.conf +++ b/systemd/user/dunst.service.d/override.conf @@ -1,2 +1,5 @@ [Service] Slice=session.slice + +[Install] +WantedBy=graphical-session.target diff --git a/systemd/user/graphical-session.target b/systemd/user/graphical-session.target new file mode 100644 index 0000000..e5d1874 --- /dev/null +++ b/systemd/user/graphical-session.target @@ -0,0 +1,15 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +[Unit] +Description=Current graphical user session +Documentation=man:systemd.special(7) +Requires=basic.target xorg.target +RefuseManualStart=yes +StopWhenUnneeded=yes diff --git a/systemd/user/graphical-session.target.wants/autocutsel-primary.service b/systemd/user/graphical-session.target.wants/autocutsel-primary.service deleted file mode 120000 index f7a06fa..0000000 --- a/systemd/user/graphical-session.target.wants/autocutsel-primary.service +++ /dev/null @@ -1 +0,0 @@ -/home/frebib/.config/systemd/user/autocutsel-primary.service \ No newline at end of file diff --git a/systemd/user/graphical-session.target.wants/autocutsel.service b/systemd/user/graphical-session.target.wants/autocutsel.service deleted file mode 120000 index b40a8f8..0000000 --- a/systemd/user/graphical-session.target.wants/autocutsel.service +++ /dev/null @@ -1 +0,0 @@ -/home/frebib/.config/systemd/user/autocutsel.service \ No newline at end of file diff --git a/systemd/user/default.target.wants/dunst.service b/systemd/user/graphical-session.target.wants/dunst.service similarity index 100% rename from systemd/user/default.target.wants/dunst.service rename to systemd/user/graphical-session.target.wants/dunst.service diff --git a/systemd/user/graphical-session.target.wants/redshift.service b/systemd/user/graphical-session.target.wants/redshift.service new file mode 120000 index 0000000..d223d81 --- /dev/null +++ b/systemd/user/graphical-session.target.wants/redshift.service @@ -0,0 +1 @@ +/home/frebib/.config/systemd/user/redshift.service \ No newline at end of file diff --git a/systemd/user/graphical-session.target.wants/xautolock.service b/systemd/user/graphical-session.target.wants/xautolock.service deleted file mode 120000 index ed32618..0000000 --- a/systemd/user/graphical-session.target.wants/xautolock.service +++ /dev/null @@ -1 +0,0 @@ -/home/frebib/.config/systemd/user/xautolock.service \ No newline at end of file diff --git a/systemd/user/redshift.service b/systemd/user/redshift.service new file mode 100644 index 0000000..06bc0b9 --- /dev/null +++ b/systemd/user/redshift.service @@ -0,0 +1,13 @@ +[Unit] +Description=Redshift display colour temperature adjustment +Documentation=http://jonls.dk/redshift/ +Requires=xorg.target +ConditionPathExists=/usr/bin/redshift + +[Service] +Slice=session.slice +ExecStart=/usr/bin/redshift +Restart=always + +[Install] +WantedBy=graphical-session.target diff --git a/systemd/user/redshift.service.d/override.conf b/systemd/user/redshift.service.d/override.conf deleted file mode 100644 index 09bac38..0000000 --- a/systemd/user/redshift.service.d/override.conf +++ /dev/null @@ -1,2 +0,0 @@ -[Service] -Slice=session.slice