diff --git a/startkde/startplasma.cpp b/startkde/startplasma.cpp index 6a2a19567..49146c23d 100644 --- a/startkde/startplasma.cpp +++ b/startkde/startplasma.cpp @@ -529,7 +529,7 @@ bool useSystemdBoot() return true; } - if (!hasSystemdService(QStringLiteral("plasma-workspace@.target"))) { + if (!hasSystemdService(QStringLiteral("plasma-workspace.target"))) { return false; } @@ -633,7 +633,7 @@ bool startPlasmaSession(bool wayland) QStringLiteral("/org/freedesktop/systemd1"), QStringLiteral("org.freedesktop.systemd1.Manager"), QStringLiteral("StartUnit")); - msg << QStringLiteral("plasma-workspace@%1.target").arg(platform) << QStringLiteral("fail"); + msg << QStringLiteral("plasma-workspace-%1.target").arg(platform) << QStringLiteral("fail"); QDBusReply reply = QDBusConnection::sessionBus().call(msg); if (!reply.isValid()) { qWarning() << "Could not start systemd managed Plasma session:" << reply.error().name() << reply.error().message(); diff --git a/startkde/systemd/CMakeLists.txt b/startkde/systemd/CMakeLists.txt index 89480801f..419c184d4 100644 --- a/startkde/systemd/CMakeLists.txt +++ b/startkde/systemd/CMakeLists.txt @@ -2,7 +2,9 @@ ecm_install_configured_files(INPUT plasma-ksplash-ready.service.in @ONLY DESTINATION ${KDE_INSTALL_SYSTEMDUSERUNITDIR}) install(FILES plasma-core.target DESTINATION ${KDE_INSTALL_SYSTEMDUSERUNITDIR}) -install(FILES plasma-workspace@.target DESTINATION ${KDE_INSTALL_SYSTEMDUSERUNITDIR}) +install(FILES plasma-workspace.target DESTINATION ${KDE_INSTALL_SYSTEMDUSERUNITDIR}) +install(FILES plasma-workspace-wayland.target DESTINATION ${KDE_INSTALL_SYSTEMDUSERUNITDIR}) +install(FILES plasma-workspace-x11.target DESTINATION ${KDE_INSTALL_SYSTEMDUSERUNITDIR}) add_executable(kde-systemd-start-condition kde-systemd-start-condition.cpp) target_link_libraries(kde-systemd-start-condition PUBLIC KF5::ConfigCore KF5::Service PlasmaAutostart) diff --git a/startkde/systemd/plasma-core.target b/startkde/systemd/plasma-core.target index 8f020b4ca..4cc4cb218 100644 --- a/startkde/systemd/plasma-core.target +++ b/startkde/systemd/plasma-core.target @@ -4,3 +4,4 @@ Wants=plasma-plasmashell.service plasma-kcminit.service plasma-kded.service plas Requires=plasma-ksmserver.service After=graphical-session-pre.target plasma-kwin_wayland.service RefuseManualStart=yes +StopWhenUnneeded=true diff --git a/startkde/systemd/plasma-workspace-wayland.target b/startkde/systemd/plasma-workspace-wayland.target new file mode 100644 index 000000000..d960413fe --- /dev/null +++ b/startkde/systemd/plasma-workspace-wayland.target @@ -0,0 +1,4 @@ +[Unit] +Requires=plasma-workspace.target +Requires=plasma-kwin_wayland.service +BindsTo=plasma-kwin_wayland.service diff --git a/startkde/systemd/plasma-workspace-x11.target b/startkde/systemd/plasma-workspace-x11.target new file mode 100644 index 000000000..154b0a0bb --- /dev/null +++ b/startkde/systemd/plasma-workspace-x11.target @@ -0,0 +1,4 @@ +[Unit] +Wants=plasma-kwin_x11.service +Requires=plasma-workspace.target +BindsTo=plasma-ksmserver.service diff --git a/startkde/systemd/plasma-workspace.target b/startkde/systemd/plasma-workspace.target new file mode 100644 index 000000000..7c5fa6ad5 --- /dev/null +++ b/startkde/systemd/plasma-workspace.target @@ -0,0 +1,8 @@ +[Unit] +Description=KDE Plasma Workspace +Requires=plasma-core.target graphical-session.target +Wants=plasma-restoresession.service plasma-xembedsniproxy.service plasma-gmenudbusmenuproxy.service plasma-powerdevil.service plasma-ksplash-ready.service plasma-polkit-agent.service kde-baloo.service plasma-foreground-booster.service plasma-kwallet-pam.service xdg-desktop-autostart.target +BindsTo=graphical-session.target +Before=graphical-session.target xdg-desktop-autostart.target plasma-ksplash-ready.service plasma-restoresession.service +RefuseManualStart=yes +StopWhenUnneeded=true diff --git a/startkde/systemd/plasma-workspace@.target b/startkde/systemd/plasma-workspace@.target deleted file mode 100644 index c5d448fe5..000000000 --- a/startkde/systemd/plasma-workspace@.target +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=KDE Plasma Workspace -Requires=plasma-core.target graphical-session.target -Wants=plasma-kwin_%i.service plasma-restoresession.service plasma-xembedsniproxy.service plasma-gmenudbusmenuproxy.service plasma-powerdevil.service plasma-ksplash-ready.service plasma-polkit-agent.service kde-baloo.service plasma-foreground-booster.service plasma-kwallet-pam.service xdg-desktop-autostart.target -BindsTo=graphical-session.target -Before=graphical-session.target xdg-desktop-autostart.target plasma-ksplash-ready.service plasma-restoresession.service