[neon/snap-packaging/plasma-core-desktop] hooks: Remove service files which will be provided by the session snap
Kevin Ottens
null at kde.org
Thu Aug 8 23:48:06 BST 2024
Git commit 0a5dd5ef9f45ad9622e26a8dfd4f172266f168ed by Kevin Ottens.
Committed on 08/08/2024 at 22:05.
Pushed by ervin into branch 'master'.
Remove service files which will be provided by the session snap
This way all those services will run confined. Before this commit (and
the accompanying one in the session snap) they would be started
unconfined, we need systemd units calling into snap which snapd will
create for us.
Since we can't force the name of those generated service files to match
the ones we need for the plasma session targets, create symlink from the
names we want to the ones which will be generated.
M +33 -1 hooks/006-add-plasma-session.chroot
https://invent.kde.org/neon/snap-packaging/plasma-core-desktop/-/commit/0a5dd5ef9f45ad9622e26a8dfd4f172266f168ed
diff --git a/hooks/006-add-plasma-session.chroot b/hooks/006-add-plasma-session.chroot
index cadf84e..7d786cb 100755
--- a/hooks/006-add-plasma-session.chroot
+++ b/hooks/006-add-plasma-session.chroot
@@ -1,4 +1,4 @@
-#!/bin/sh -x
+#!/bin/bash -x
set -e
@@ -118,10 +118,42 @@ rm -f /etc/systemd/user/sockets.target.wants/pipewire*
rm -f /etc/systemd/user/default.target.wants/pipewire*
rm -f /usr/lib/systemd/user/org.freedesktop.IBus.session.generic.service
+# Remove autostart files provided by the session snap
+rm /etc/xdg/autostart/kaccess.desktop
+rm /etc/xdg/autostart/org.kde.xwaylandvideobridge.desktop
+
# Remove D-Bus service activation files provided by
# the session snap.
rm /usr/share/dbus-1/services/org.freedesktop.impl.portal.desktop.kde.service
rm /usr/lib/systemd/user/plasma-xdg-desktop-portal-kde.service
+rm /usr/share/dbus-1/services/org.kde.ActivityManager.service
+rm /usr/share/dbus-1/services/org.kde.kded6.service
+rm /usr/share/dbus-1/services/org.kde.KSplash.service
+rm /usr/share/dbus-1/services/org.kde.LogoutPrompt.service
+rm /usr/share/dbus-1/services/org.kde.Shutdown.service
+rm /usr/share/dbus-1/services/org.kde.krunner.service
+rm /usr/share/dbus-1/services/org.kde.ksystemstats1.service
+
+rm "/usr/lib/systemd/user/plasma-kwin_wayland.service"
+ln -s "/etc/systemd/user/snap.plasma-desktop-session.plasma-kwin-wayland.service" "/usr/lib/systemd/user/plasma-kwin_wayland.service"
+snapped_services=(
+ plasma-ksplash
+ plasma-ksmserver
+ plasma-kcminit
+ plasma-plasmashell
+ plasma-kded6
+ plasma-kglobalaccel
+ plasma-kactivitymanagerd
+ plasma-xembedsniproxy
+ plasma-gmenudbusmenuproxy
+ plasma-powerdevil
+ plasma-krunner
+ plasma-ksystemstats
+)
+for service in "${snapped_services[@]}"; do
+ rm "/usr/lib/systemd/user/$service.service"
+ ln -s "/etc/systemd/user/snap.plasma-desktop-session.$service.service" "/usr/lib/systemd/user/$service.service"
+done
# Remove the XDG desktop portal platform theme, components
# of the session must not go through it
More information about the Neon-commits
mailing list