diff --git a/Containerfile b/Containerfile index 6691c037..77a94f8a 100644 --- a/Containerfile +++ b/Containerfile @@ -333,7 +333,8 @@ RUN if grep -q "kinoite" <<< "${BASE_IMAGE_NAME}"; then \ sed -i 's@Exec=prompt@Exec=kde-prompt@g' /usr/share/applications/org.gnome.Prompt.desktop && \ cp /usr/share/applications/org.gnome.Prompt.desktop /usr/share/kglobalaccel/org.gnome.Prompt.desktop && \ sed -i 's@\[Desktop Entry\]@\[Desktop Entry\]\nNoDisplay=true@g' /usr/share/applications/org.kde.konsole.desktop && \ - rm -f /usr/share/kglobalaccel/org.kde.konsole.desktop \ + rm -f /usr/share/kglobalaccel/org.kde.konsole.desktop && \ + systemctl enable kde-sysmonitor-workaround.service \ ; else \ rpm-ostree override replace \ --experimental \ diff --git a/system_files/desktop/kinoite/usr/lib/systemd/system/kde-sysmonitor-workaround.service b/system_files/desktop/kinoite/usr/lib/systemd/system/kde-sysmonitor-workaround.service new file mode 100644 index 00000000..2bef6b04 --- /dev/null +++ b/system_files/desktop/kinoite/usr/lib/systemd/system/kde-sysmonitor-workaround.service @@ -0,0 +1,20 @@ +[Unit] +Description=Workaround KDE System Monitor not having the correct caps +ConditionFileIsExecutable=/usr/libexec/ksysguard/ksgrd_network_helper +After=local-fs.target + +[Service] +Type=oneshot +# Copy if it doesn't exist +ExecStartPre=/usr/bin/bash -c "[ -x /usr/local/libexec/.ksysguard/ksgrd_network_helper ] || /usr/bin/cp /usr/libexec/ksysguard/ksgrd_network_helper /usr/local/libexec/.ksysguard/ksgrd_network_helper" +# This is faster than using .mount unit. Also allows for the previous line/cleanup +ExecStartPre=/usr/bin/mount --bind /usr/local/libexec/.ksysguard/ksgrd_network_helper /usr/libexec/ksysguard/ksgrd_network_helper +# Fix caps +ExecStart=/usr/sbin/setcap 'cap_net_raw+ep' /usr/libexec/ksysguard/ksgrd_network_helper +# Clean-up after ourselves +ExecStop=/usr/bin/umount /usr/libexec/ksysguard/ksgrd_network_helper +ExecStop=/usr/bin/rm /usr/local/libexec/.ksysguard/ksgrd_network_helper +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/system_files/desktop/kinoite/usr/lib/tmpfiles.d/kde-sysmonitor-workaround.conf b/system_files/desktop/kinoite/usr/lib/tmpfiles.d/kde-sysmonitor-workaround.conf new file mode 100644 index 00000000..4bc92bc6 --- /dev/null +++ b/system_files/desktop/kinoite/usr/lib/tmpfiles.d/kde-sysmonitor-workaround.conf @@ -0,0 +1 @@ +C /usr/local/libexec/.ksysguard/ksgrd_network_helper - - - - /usr/libexec/ksysguard/ksgrd_network_helper