aerothemeplasma/misc/libplasma/apply
wackyideas 6ff6ef2e12 Improve libplasma installation method
Up until now compiling libplasma modifications was rather violent as it
would cause both plasmashell and kwin to crash (the latter is
potentially destructive if running a Wayland session), leaving the user
with a potentially unstable state where plasmashell will start to
crashloop until the entire system reboots.

With this commit, the replacement of patched library files is deferred
until the system restarts, by using a temporary systemd service that
performs the replacement of files before Plasma starts, leading to
no crashes during the install or update process.
2025-10-20 17:37:54 +02:00

26 lines
641 B
Bash

#!/bin/bash
INSTALLDST="/usr/lib/x86_64-linux-gnu/qt6/qml/org/kde/plasma/core/libcorebindingsplugin.so"
LIBDIR="/usr/lib/x86_64-linux-gnu/"
TMPDIR="/opt/aerothemeplasma/tmp"
if [ ! -d ${LIBDIR} ]; then
LIBDIR="/usr/lib64/"
fi
if [ ! -f ${INSTALLDST} ]; then
INSTALLDST="/usr/lib64/qt6/qml/org/kde/plasma/core/libcorebindingsplugin.so"
fi
cp "$TMPDIR/libcorebindingsplugin.so" $INSTALLDST
for filename in "$TMPDIR/libPlasma"*; do
echo "Copying $filename to $LIBDIR"
cp "$filename" "$LIBDIR"
done
echo "Done."
systemctl disable apply-libplasma-patches.service
rm -f /etc/systemd/system/apply-libplasma-patches.service
rm -r $TMPDIR