fix(kde): Correct caps for KDE's System Monitor

Fixes #689
This commit is contained in:
Kyle Gospodnetich 2024-01-17 12:58:25 -08:00
parent 7066a0c090
commit 62c69ec585
3 changed files with 23 additions and 1 deletions

View File

@ -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 \

View File

@ -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

View File

@ -0,0 +1 @@
C /usr/local/libexec/.ksysguard/ksgrd_network_helper - - - - /usr/libexec/ksysguard/ksgrd_network_helper