#!/bin/sh
# LinuxDoors wrapper: KF6 QML/plugins under /usr/lib, Qt6 under /opt/qt6-full;
# no per-user systemd manager (x2go / lightdm-no-logind-seat) -> legacy session boot;
# ensure a session D-Bus bus exists (startplasma-x11 hangs at ksplash without one).
export QT_PLUGIN_PATH="/usr/lib/plugins:/opt/qt6-full/plugins${QT_PLUGIN_PATH:+:$QT_PLUGIN_PATH}"
export QML2_IMPORT_PATH="/usr/lib/qml:/opt/qt6-full/qml${QML2_IMPORT_PATH:+:$QML2_IMPORT_PATH}"
export QML_IMPORT_PATH="/usr/lib/qml:/opt/qt6-full/qml${QML_IMPORT_PATH:+:$QML_IMPORT_PATH}"
[ -z "$PLASMA_USE_SYSTEMD" ] && export PLASMA_USE_SYSTEMD=false
# The themed Breeze lock screen's clock->login reveal loses the password
# field's Qt active focus on this build (reproduced both over x2go/nxagent
# and on a real X11 console session) -- use the simple built-in locker always.
export KSCREENLOCKER_SIMPLE_GREETER=1
if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && command -v dbus-run-session >/dev/null 2>&1; then
    exec dbus-run-session -- /usr/bin/startplasma-x11.real "$@"
fi
exec /usr/bin/startplasma-x11.real "$@"
