A notable observation: the kde-frameworks-5-core18
snap ships the KDE Plasma platform theme. The developer may want to prevent loading said theme by setting QT_QPA_PLATFORMTHEME
to something not kde for whatever reason, e.g. an incompatibility with the application.
However, the KDE Plasma platform theme will still be loaded if the snap’s being run in a KDE session. The env variables XDG_CURRENT_DESKTOP
and KDE_FULL_SESSION
affect whether this platform theme is loaded.
A possible solution is to incorporate a wrapper script that unsets said env vars:
if [ ! -z "$KDE_FULL_SESSION" ]; then
unset KDE_FULL_SESSION
fi
if echo "$XDG_CURRENT_DESKTOP" | grep -q KDE; then
unset XDG_CURRENT_DESKTOP
fi